mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Allow output_path to be None during training
This commit is contained in:
parent
ffc371350a
commit
146af1dc17
|
@ -100,7 +100,8 @@ def train(
|
||||||
if is_best_checkpoint is not None and output_path is not None:
|
if is_best_checkpoint is not None and output_path is not None:
|
||||||
with nlp.select_pipes(disable=frozen_components):
|
with nlp.select_pipes(disable=frozen_components):
|
||||||
update_meta(T, nlp, info)
|
update_meta(T, nlp, info)
|
||||||
save_checkpoint(is_best_checkpoint)
|
if output_path is not None:
|
||||||
|
save_checkpoint(is_best_checkpoint)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if output_path is not None:
|
if output_path is not None:
|
||||||
stdout.write(
|
stdout.write(
|
||||||
|
@ -113,7 +114,8 @@ def train(
|
||||||
raise e
|
raise e
|
||||||
finally:
|
finally:
|
||||||
finalize_logger()
|
finalize_logger()
|
||||||
save_checkpoint(False)
|
if output_path is not None:
|
||||||
|
save_checkpoint(False)
|
||||||
# This will only run if we did't hit an error
|
# This will only run if we did't hit an error
|
||||||
if optimizer.averages:
|
if optimizer.averages:
|
||||||
nlp.use_params(optimizer.averages)
|
nlp.use_params(optimizer.averages)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user