Skip to content

Commit

Permalink
Avoid forcing a name on empty vectors, and remove print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Mar 28, 2018
1 parent cf5fcf0 commit a7c5ae2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spacy/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit a7c5ae2

Please sign in to comment.