From a7c5ae2bebe7053736650e4722eb2ad5db68fb31 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 28 Mar 2018 21:08:58 +0200 Subject: [PATCH] Avoid forcing a name on empty vectors, and remove print statement --- spacy/language.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index fe3c574a1..cb37b62fc 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -695,6 +695,8 @@ def _fix_pretrained_vectors_name(nlp): # data if 'vectors' in nlp.meta and nlp.meta['vectors'].get('name'): nlp.vocab.vectors.name = nlp.meta['vectors']['name'] + elif not nlp.vocab.vectors.size: + nlp.vocab.vectors.name = None elif 'name' in nlp.meta and 'lang' in nlp.meta: vectors_name = '%s_%s.vectors' % (nlp.meta['lang'], nlp.meta['name']) nlp.vocab.vectors.name = vectors_name @@ -706,7 +708,6 @@ def _fix_pretrained_vectors_name(nlp): if proc.cfg.get('pretrained_dims'): assert nlp.vocab.vectors.name proc.cfg['pretrained_vectors'] = nlp.vocab.vectors.name - print(proc.cfg) class DisabledPipes(list):