mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Warn and fallback if vectors have no name
This commit is contained in:
parent
fd9e259414
commit
f8dd905a24
|
@ -243,8 +243,9 @@ class PrecomputableAffine(Model):
|
||||||
def link_vectors_to_models(vocab):
|
def link_vectors_to_models(vocab):
|
||||||
vectors = vocab.vectors
|
vectors = vocab.vectors
|
||||||
if vectors.name is None:
|
if vectors.name is None:
|
||||||
raise ValueError(
|
vectors.name = VECTORS_KEY
|
||||||
"Unnamed vectors -- this won't allow multiple vectors "
|
print(
|
||||||
|
"Warning: Unnamed vectors -- this won't allow multiple vectors "
|
||||||
"models to be loaded. (Shape: (%d, %d))" % vectors.data.shape)
|
"models to be loaded. (Shape: (%d, %d))" % vectors.data.shape)
|
||||||
ops = Model.ops
|
ops = Model.ops
|
||||||
for word in vocab:
|
for word in vocab:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user