mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Fix download.py for GloVe vectors.
This commit is contained in:
parent
edc45c19d6
commit
5a5c7192a5
|
@ -14,7 +14,8 @@ def download(lang, force=False, fail_on_exist=True):
|
|||
sputnik.purge(about.__title__, about.__version__)
|
||||
|
||||
try:
|
||||
sputnik.package(about.__title__, about.__version__, about.__models__[lang])
|
||||
sputnik.package(about.__title__, about.__version__,
|
||||
about.__models__.get(lang, lang))
|
||||
if fail_on_exist:
|
||||
print("Model already installed. Please run 'python -m "
|
||||
"spacy.%s.download --force' to reinstall." % lang, file=sys.stderr)
|
||||
|
@ -22,10 +23,12 @@ def download(lang, force=False, fail_on_exist=True):
|
|||
except (PackageNotFoundException, CompatiblePackageNotFoundException):
|
||||
pass
|
||||
|
||||
package = sputnik.install(about.__title__, about.__version__, about.__models__[lang])
|
||||
package = sputnik.install(about.__title__, about.__version__,
|
||||
about.__models__.get(lang, lang))
|
||||
|
||||
try:
|
||||
sputnik.package(about.__title__, about.__version__, about.__models__[lang])
|
||||
sputnik.package(about.__title__, about.__version__,
|
||||
about.__models__.get(lang, lang))
|
||||
except (PackageNotFoundException, CompatiblePackageNotFoundException):
|
||||
print("Model failed to install. Please run 'python -m "
|
||||
"spacy.%s.download --force'." % lang, file=sys.stderr)
|
||||
|
|
Loading…
Reference in New Issue
Block a user