pretrain-predict: create dir if not exists

This commit is contained in:
Starbeamrainbowlabs 2022-10-10 18:00:55 +01:00
parent deede32241
commit 131c0a0a5b
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -56,6 +56,10 @@ def run(args):
if not os.path.exists(args.checkpoint):
raise Exception(f"Error: The specified filepath to the checkpoint to load ('{args.checkpoint}) does not exist.")
if args.records_per_file > 0:
dirpath_output=os.path.dirname(args.output)
if not os.path.exists(dirpath_output):
os.mkdir(dirpath_output)
filepath_output = args.output if hasattr(args, "output") and args.output != None else "-"