mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 16:22:29 +03:00
add default_model to about
This commit is contained in:
parent
788f734513
commit
780cb847c9
1
setup.py
1
setup.py
|
@ -158,6 +158,7 @@ version = '%(version)s'
|
||||||
full_version = '%(full_version)s'
|
full_version = '%(full_version)s'
|
||||||
git_revision = '%(git_revision)s'
|
git_revision = '%(git_revision)s'
|
||||||
release = %(isrelease)s
|
release = %(isrelease)s
|
||||||
|
default_model = 'en_default==1.0.4'
|
||||||
if not release:
|
if not release:
|
||||||
version = full_version
|
version = full_version
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -39,16 +39,15 @@ def link(package, path):
|
||||||
force=("Force overwrite", "flag", "f", bool),
|
force=("Force overwrite", "flag", "f", bool),
|
||||||
)
|
)
|
||||||
def main(data_size='all', force=False):
|
def main(data_size='all', force=False):
|
||||||
package_name = 'en_default==1.0.4'
|
|
||||||
path = os.path.dirname(os.path.abspath(__file__))
|
path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
if force:
|
if force:
|
||||||
sputnik.purge('spacy', about.short_version)
|
sputnik.purge('spacy', about.short_version)
|
||||||
|
|
||||||
package = sputnik.install('spacy', about.short_version, package_name)
|
package = sputnik.install('spacy', about.short_version, about.default_model)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sputnik.package('spacy', about.short_version, package_name)
|
sputnik.package('spacy', about.short_version, about.default_model)
|
||||||
except PackageNotFoundException, CompatiblePackageNotFoundException:
|
except PackageNotFoundException, CompatiblePackageNotFoundException:
|
||||||
print("Model failed to install. Please run 'python -m "
|
print("Model failed to install. Please run 'python -m "
|
||||||
"spacy.en.download --force'.", file=sys.stderr)
|
"spacy.en.download --force'.", file=sys.stderr)
|
||||||
|
|
|
@ -196,7 +196,7 @@ class Language(object):
|
||||||
via = data_dir
|
via = data_dir
|
||||||
|
|
||||||
if via is None:
|
if via is None:
|
||||||
package = util.get_package_by_name('en_default==1.0.4')
|
package = util.get_package_by_name(about.default_model)
|
||||||
else:
|
else:
|
||||||
package = util.get_package(via)
|
package = util.get_package(via)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user