improve python script error messages

This commit is contained in:
josc146
2023-07-07 20:16:35 +08:00
parent 2d545604f4
commit 6fbb86667c
9 changed files with 115 additions and 65 deletions

View File

@@ -219,13 +219,17 @@ def get_args():
return p.parse_args()
args = get_args()
if not args.quiet:
print(f"** {args}")
try:
args = get_args()
if not args.quiet:
print(f"** {args}")
RWKV(
getattr(args, "in"),
args.strategy,
verbose=not args.quiet,
convert_and_save_and_exit=args.out,
)
RWKV(
getattr(args, "in"),
args.strategy,
verbose=not args.quiet,
convert_and_save_and_exit=args.out,
)
except Exception as e:
with open("error.txt", "w") as f:
f.write(str(e))