From f8dd905a24b964aca33a36bb150150374d857177 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 28 Mar 2018 18:24:53 +0200 Subject: [PATCH] Warn and fallback if vectors have no name --- spacy/_ml.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index d4f0e8bef..2d366af74 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -243,8 +243,9 @@ class PrecomputableAffine(Model): 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: