mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-04 13:13:10 +03:00
Fix model package loading from link
This commit is contained in:
parent
dd6dc4c120
commit
ea167e14db
|
@ -112,7 +112,8 @@ def load_model(name, **overrides):
|
||||||
|
|
||||||
def load_model_from_link(name, **overrides):
|
def load_model_from_link(name, **overrides):
|
||||||
"""Load a model from a shortcut link, or directory in spaCy data path."""
|
"""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:
|
try:
|
||||||
cls = importlib.util.module_from_spec(spec)
|
cls = importlib.util.module_from_spec(spec)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user