Skip to content

Commit

Permalink
Fix issue #684: GloVe vectors not loaded in spacy.en.English.
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Dec 18, 2016
1 parent 404019a commit 618b50a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spacy/en/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from os import path

from ..util import match_best_version
from ..util import get_data_path
from ..language import Language
from ..lemmatizer import Lemmatizer
from ..vocab import Vocab
Expand Down Expand Up @@ -37,10 +38,11 @@ def _fix_deprecated_glove_vectors_loading(overrides):
if 'data_dir' in overrides and 'path' not in overrides:
raise ValueError("The argument 'data_dir' has been renamed to 'path'")
if overrides.get('path') is None:
return overrides
path = overrides['path']
if 'add_vectors' not in overrides:
data_path = get_data_path()
else:
path = overrides['path']
data_path = path.parent
if 'add_vectors' not in overrides:
if 'vectors' in overrides:
vec_path = match_best_version(overrides['vectors'], None, data_path)
if vec_path is None:
Expand Down

0 comments on commit 618b50a

Please sign in to comment.