From 5a5c7192a58b26837d375ad683d59622c73d267f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 19 Oct 2016 00:47:44 +0200 Subject: [PATCH] Fix download.py for GloVe vectors. --- spacy/download.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spacy/download.py b/spacy/download.py index 2efa28630..1af97eb76 100644 --- a/spacy/download.py +++ b/spacy/download.py @@ -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)