Skip to content
Snippets Groups Projects
Commit 812cd272 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Allow .whl file format for spacy model files

parent 31fa45d2
No related branches found
No related tags found
No related merge requests found
......@@ -24,14 +24,16 @@ def install_spacy_models():
if not os.path.isdir(spacy_models_dir):
return
for model_file in os.listdir(spacy_models_dir):
print('Installing spaCy model file "{}"...'.format(model_file))
if not os.path.isfile(os.path.join(spacy_models_dir, model_file)):
continue
if not model_file.lower().endswith('.tar.gz'):
if not model_file.lower().endswith(('.tar.gz', '.whl')):
continue
cmd = 'python3 -m pip install "{}"'.format(
os.path.join(spacy_models_dir, model_file)
)
os.popen(cmd).readlines()
print('Done')
def get_spacy_models():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment