Skip to content

Commit

Permalink
Warn and fallback if vectors have no name
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Mar 28, 2018
1 parent fd9e259 commit f8dd905
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spacy/_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ def predict(ids, tokvecs):
def link_vectors_to_models(vocab):
vectors = vocab.vectors
if vectors.name is None:
raise ValueError(
"Unnamed vectors -- this won't allow multiple vectors "
vectors.name = VECTORS_KEY
print(
"Warning: Unnamed vectors -- this won't allow multiple vectors "
"models to be loaded. (Shape: (%d, %d))" % vectors.data.shape)
ops = Model.ops
for word in vocab:
Expand Down

0 comments on commit f8dd905

Please sign in to comment.