Skip to content

Commit

Permalink
Fix spacy test failure caused by spacy 3.10 (mlflow#4541)
Browse files Browse the repository at this point in the history
* remove _sourced_vectors_hashes

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

* set default

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy authored Jul 9, 2021
1 parent c96f4d8 commit ec6a16e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/spacy/test_spacy_model_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def test_model_save_load(spacy_model_with_data, model_path):
mlflow.spacy.save_model(spacy_model=spacy_model, path=model_path)
loaded_model = mlflow.spacy.load_model(model_path)

# Remove a `_sourced_vectors_hashes` field which is added when spaCy loads a model:
# https://github.com/explosion/spaCy/blob/e8ef4a46d5dbc9bb6d629ecd0b02721d6bdf2f87/spacy/language.py#L1701
loaded_model.meta.pop("_sourced_vectors_hashes", None)

# Comparing the meta dictionaries for the original and loaded models
assert spacy_model.meta == loaded_model.meta

Expand Down

0 comments on commit ec6a16e

Please sign in to comment.