mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix #578 -- Sputnik had been purging all files on --force, not just the relevant one.
This commit is contained in:
parent
6e37ba1d82
commit
ab952b4756
|
@ -11,13 +11,12 @@ from . import util
|
|||
|
||||
|
||||
def download(lang, force=False, fail_on_exist=True):
|
||||
if force:
|
||||
sputnik.purge(about.__title__, about.__version__)
|
||||
|
||||
try:
|
||||
sputnik.package(about.__title__, about.__version__,
|
||||
pkg = sputnik.package(about.__title__, about.__version__,
|
||||
about.__models__.get(lang, lang))
|
||||
if fail_on_exist:
|
||||
if force:
|
||||
shutil.rmtree(pkg.path)
|
||||
elif 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