mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
Only compile list of models if data_path exists
This commit is contained in:
parent
b4c583a8dd
commit
84341c2975
|
@ -49,5 +49,6 @@ def list_models():
|
|||
# won't show up in list, but it seems worth it
|
||||
exclude = ['cache', 'pycache', '__pycache__']
|
||||
data_path = util.get_data_path()
|
||||
models = [f.parts[-1] for f in data_path.iterdir() if f.is_dir()]
|
||||
return [m for m in models if m not in exclude]
|
||||
if data_path:
|
||||
models = [f.parts[-1] for f in data_path.iterdir() if f.is_dir()]
|
||||
return [m for m in models if m not in exclude]
|
||||
|
|
Loading…
Reference in New Issue
Block a user