Allow output_path to be None during training

This commit is contained in:
Ines Montani 2021-01-25 11:51:19 +11:00
parent ffc371350a
commit 146af1dc17

View File

@ -100,6 +100,7 @@ def train(
if is_best_checkpoint is not None and output_path is not None:
with nlp.select_pipes(disable=frozen_components):
update_meta(T, nlp, info)
if output_path is not None:
save_checkpoint(is_best_checkpoint)
except Exception as e:
if output_path is not None:
@ -113,6 +114,7 @@ def train(
raise e
finally:
finalize_logger()
if output_path is not None:
save_checkpoint(False)
# This will only run if we did't hit an error
if optimizer.averages: