mirror of https://github.com/explosion/spaCy.git
fix meta serialization in train (#5751)
Co-authored-by: Mark Neumann <markng@allenai.org>
This commit is contained in:
parent
0a62098c5f
commit
27a1cd3c63
|
@ -576,6 +576,8 @@ def train(
|
||||||
with nlp.use_params(optimizer.averages):
|
with nlp.use_params(optimizer.averages):
|
||||||
final_model_path = output_path / "model-final"
|
final_model_path = output_path / "model-final"
|
||||||
nlp.to_disk(final_model_path)
|
nlp.to_disk(final_model_path)
|
||||||
|
srsly.write_json(final_model_path / "meta.json", meta)
|
||||||
|
|
||||||
meta_loc = output_path / "model-final" / "meta.json"
|
meta_loc = output_path / "model-final" / "meta.json"
|
||||||
final_meta = srsly.read_json(meta_loc)
|
final_meta = srsly.read_json(meta_loc)
|
||||||
final_meta.setdefault("accuracy", {})
|
final_meta.setdefault("accuracy", {})
|
||||||
|
|
Loading…
Reference in New Issue