Skip to content
Snippets Groups Projects
Commit c24d252e authored by Maja Jablonska's avatar Maja Jablonska
Browse files

Small changes to creating existing paths

parent 60cac6c5
No related branches found
No related tags found
1 merge request!46Merge COMBO 3.0 into master
......@@ -282,7 +282,10 @@ def run(_):
'to use default models.')
return
try:
pathlib.Path(FLAGS.serialization_dir).mkdir(parents=True, exist_ok=True)
except FileExistsError:
pass
serialization_dir = tempfile.mkdtemp(prefix='combo', dir=FLAGS.serialization_dir)
else:
......@@ -304,7 +307,10 @@ def run(_):
vocabulary = model.vocab
try:
pathlib.Path(FLAGS.serialization_dir).mkdir(parents=True, exist_ok=True)
except FileExistsError:
pass
serialization_dir = tempfile.mkdtemp(prefix='combo', suffix='-finetuning', dir=FLAGS.serialization_dir)
dataset_reader, training_data_loader, validation_data_loader, vocabulary = get_defaults(
......@@ -371,7 +377,10 @@ def run(_):
except ConfigurationError as e:
handle_error(e, prefix)
try:
pathlib.Path(FLAGS.output_file).mkdir(parents=True, exist_ok=True)
except FileExistsError:
pass
logger.info("Predicting examples from file", prefix=prefix)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment