mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-06 06:03:11 +03:00
Make cli/train.py not eat exception
This commit is contained in:
parent
020a7e5d52
commit
e188b61960
|
@ -165,12 +165,9 @@ def train(cmd, lang, output_dir, train_data, dev_data, n_iter=30, n_sents=0,
|
||||||
gpu_wps=gpu_wps)
|
gpu_wps=gpu_wps)
|
||||||
finally:
|
finally:
|
||||||
print("Saving model...")
|
print("Saving model...")
|
||||||
try:
|
with (output_path / 'model-final.pickle').open('wb') as file_:
|
||||||
with (output_path / 'model-final.pickle').open('wb') as file_:
|
with nlp.use_params(optimizer.averages):
|
||||||
with nlp.use_params(optimizer.averages):
|
dill.dump(nlp, file_, -1)
|
||||||
dill.dump(nlp, file_, -1)
|
|
||||||
except:
|
|
||||||
print("Error saving model")
|
|
||||||
|
|
||||||
|
|
||||||
def _render_parses(i, to_render):
|
def _render_parses(i, to_render):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user