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
Branches
Tags
1 merge request!46Merge COMBO 3.0 into master
......@@ -282,7 +282,10 @@ def run(_):
'to use default models.')
return
pathlib.Path(FLAGS.serialization_dir).mkdir(parents=True, exist_ok=True)
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
pathlib.Path(FLAGS.serialization_dir).mkdir(parents=True, exist_ok=True)
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)
pathlib.Path(FLAGS.output_file).mkdir(parents=True, exist_ok=True)
try:
pathlib.Path(FLAGS.output_file).mkdir(parents=True, exist_ok=True)
except FileExistsError:
pass
logger.info("Predicting examples from file", prefix=prefix)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment