mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-15 06:09:01 +03:00
In initialize only calculate current vectors hash if needed (#12607)
This commit is contained in:
parent
42e5043816
commit
2cfbc1209d
|
@ -133,6 +133,7 @@ def init_vocab(
|
||||||
logger.info("Added vectors: %s", vectors)
|
logger.info("Added vectors: %s", vectors)
|
||||||
# warn if source model vectors are not identical
|
# warn if source model vectors are not identical
|
||||||
sourced_vectors_hashes = nlp.meta.pop("_sourced_vectors_hashes", {})
|
sourced_vectors_hashes = nlp.meta.pop("_sourced_vectors_hashes", {})
|
||||||
|
if len(sourced_vectors_hashes) > 0:
|
||||||
vectors_hash = hash(nlp.vocab.vectors.to_bytes(exclude=["strings"]))
|
vectors_hash = hash(nlp.vocab.vectors.to_bytes(exclude=["strings"]))
|
||||||
for sourced_component, sourced_vectors_hash in sourced_vectors_hashes.items():
|
for sourced_component, sourced_vectors_hash in sourced_vectors_hashes.items():
|
||||||
if vectors_hash != sourced_vectors_hash:
|
if vectors_hash != sourced_vectors_hash:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user