mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-24 16:24:16 +03:00
Make "unnamed vectors" warning a real warning
This commit is contained in:
parent
b5d999e510
commit
3ba5238282
|
@ -286,10 +286,7 @@ def link_vectors_to_models(vocab):
|
|||
if vectors.name is None:
|
||||
vectors.name = VECTORS_KEY
|
||||
if vectors.data.size != 0:
|
||||
print(
|
||||
"Warning: Unnamed vectors -- this won't allow multiple vectors "
|
||||
"models to be loaded. (Shape: (%d, %d))" % vectors.data.shape
|
||||
)
|
||||
user_warning(Warnings.W020.format(shape=vectors.data.shape))
|
||||
ops = Model.ops
|
||||
for word in vocab:
|
||||
if word.orth in vectors.key2row:
|
||||
|
|
|
@ -84,6 +84,8 @@ class Warnings(object):
|
|||
W018 = ("Entity '{entity}' already exists in the Knowledge base.")
|
||||
W019 = ("Changing vectors name from {old} to {new}, to avoid clash with "
|
||||
"previously loaded vectors. See Issue #3853.")
|
||||
W020 = ("Unnamed vectors. This won't allow multiple vectors models to be "
|
||||
"loaded. (Shape: {shape})")
|
||||
|
||||
|
||||
@add_codes
|
||||
|
|
Loading…
Reference in New Issue
Block a user