From a350be0601113d6f2e1b07a7d40ab5e384a101f6 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 4 Apr 2018 01:31:25 +0200 Subject: [PATCH] Fix vector-name loading fix --- spacy/language.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 9fd922878..425b3c4a3 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -696,6 +696,7 @@ class Language(object): msg = util.from_bytes(bytes_data, deserializers, {}) return self + def _fix_pretrained_vectors_name(nlp): # TODO: Replace this once we handle vectors consistently as static # data @@ -708,7 +709,8 @@ def _fix_pretrained_vectors_name(nlp): nlp.vocab.vectors.name = vectors_name else: raise ValueError(Errors.E092) - link_vectors_to_models(nlp.vocab) + if nlp.vocab.vectors.size != 0: + link_vectors_to_models(nlp.vocab) for name, proc in nlp.pipeline: if not hasattr(proc, 'cfg'): continue