Allow overriding spacy_version in spacy package meta (#11552)

This commit is contained in:
Adriane Boyd 2022-09-29 10:44:06 +02:00 committed by GitHub
parent e794d4ae39
commit 6d7630c5d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,8 +299,8 @@ def get_meta(
} }
nlp = util.load_model_from_path(Path(model_path)) nlp = util.load_model_from_path(Path(model_path))
meta.update(nlp.meta) meta.update(nlp.meta)
meta.update(existing_meta)
meta["spacy_version"] = util.get_minor_version_range(about.__version__) meta["spacy_version"] = util.get_minor_version_range(about.__version__)
meta.update(existing_meta)
meta["vectors"] = { meta["vectors"] = {
"width": nlp.vocab.vectors_length, "width": nlp.vocab.vectors_length,
"vectors": len(nlp.vocab.vectors), "vectors": len(nlp.vocab.vectors),