mirror of
https://github.com/explosion/spaCy.git
synced 2025-05-02 23:03:41 +03:00
Only warn about unnamed vectors if non-zero sized.
This commit is contained in:
parent
260707a4c3
commit
401213fb1f
|
@ -229,9 +229,10 @@ def link_vectors_to_models(vocab):
|
||||||
vectors = vocab.vectors
|
vectors = vocab.vectors
|
||||||
if vectors.name is None:
|
if vectors.name is None:
|
||||||
vectors.name = VECTORS_KEY
|
vectors.name = VECTORS_KEY
|
||||||
print(
|
if vectors.data.size != 0:
|
||||||
"Warning: Unnamed vectors -- this won't allow multiple vectors "
|
print(
|
||||||
"models to be loaded. (Shape: (%d, %d))" % vectors.data.shape)
|
"Warning: Unnamed vectors -- this won't allow multiple vectors "
|
||||||
|
"models to be loaded. (Shape: (%d, %d))" % vectors.data.shape)
|
||||||
ops = Model.ops
|
ops = Model.ops
|
||||||
for word in vocab:
|
for word in vocab:
|
||||||
if word.orth in vectors.key2row:
|
if word.orth in vectors.key2row:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user