fix meta serialization in train (#5751)

Co-authored-by: Mark Neumann <markng@allenai.org>
This commit is contained in:
Mark Neumann 2020-07-12 13:06:46 -07:00 committed by GitHub
parent 0a62098c5f
commit 27a1cd3c63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -576,6 +576,8 @@ def train(
with nlp.use_params(optimizer.averages):
final_model_path = output_path / "model-final"
nlp.to_disk(final_model_path)
srsly.write_json(final_model_path / "meta.json", meta)
meta_loc = output_path / "model-final" / "meta.json"
final_meta = srsly.read_json(meta_loc)
final_meta.setdefault("accuracy", {})