From ea167e14dbd32e902fa693c83620b56f478cb277 Mon Sep 17 00:00:00 2001 From: ines Date: Mon, 5 Jun 2017 13:10:49 +0200 Subject: [PATCH] Fix model package loading from link --- spacy/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/util.py b/spacy/util.py index 6c6479382..ccb81fbed 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -112,7 +112,8 @@ def load_model(name, **overrides): def load_model_from_link(name, **overrides): """Load a model from a shortcut link, or directory in spaCy data path.""" - spec = importlib.util.spec_from_file_location('model', get_data_path() / name) + init_file = get_data_path() / name / '__init__.py' + spec = importlib.util.spec_from_file_location(name, init_file) try: cls = importlib.util.module_from_spec(spec) except AttributeError: