mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 18:56:36 +03:00
Merge pull request #501 from lababidi/master
Add parameter to download()
This commit is contained in:
commit
2f7ef4b150
|
@ -9,12 +9,13 @@ from sputnik.package_list import (PackageNotFoundException,
|
|||
from . import about
|
||||
|
||||
|
||||
def download(lang, force=False):
|
||||
def download(lang, force=False, fail_on_exist=True):
|
||||
if force:
|
||||
sputnik.purge(about.__title__, about.__version__)
|
||||
|
||||
try:
|
||||
sputnik.package(about.__title__, about.__version__, about.__models__[lang])
|
||||
if fail_on_exist:
|
||||
print("Model already installed. Please run 'python -m "
|
||||
"spacy.%s.download --force' to reinstall." % lang, file=sys.stderr)
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user