mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Link model automatically if not direct download
This commit is contained in:
parent
618ce3b425
commit
8253581057
|
@ -5,6 +5,7 @@ import pip
|
|||
import plac
|
||||
import requests
|
||||
from os import path
|
||||
from .link import link
|
||||
from . import about
|
||||
from . import util
|
||||
|
||||
|
@ -21,11 +22,11 @@ def download(model=None, direct=False):
|
|||
if direct:
|
||||
download_model('{m}/{m}.tar.gz'.format(m=model))
|
||||
else:
|
||||
model = about.__shortcuts__[model] if model in about.__shortcuts__ else model
|
||||
model_name = about.__shortcuts__[model] if model in about.__shortcuts__ else model
|
||||
compatibility = get_compatibility()
|
||||
version = get_version(model, compatibility)
|
||||
download_model('{m}-{v}/{m}-{v}.tar.gz'.format(m=model, v=version))
|
||||
|
||||
version = get_version(model_name, compatibility)
|
||||
download_model('{m}-{v}/{m}-{v}.tar.gz'.format(m=model_name, v=version))
|
||||
link(model_name, model, force=True)
|
||||
|
||||
def get_compatibility():
|
||||
version = about.__version__
|
||||
|
|
Loading…
Reference in New Issue
Block a user