mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Possible solution to #909
This commit is contained in:
parent
f40fbc3710
commit
b7f714b498
|
@ -5,6 +5,7 @@ import pip
|
|||
from pathlib import Path
|
||||
import importlib
|
||||
from .. import util
|
||||
import sys
|
||||
|
||||
|
||||
def link(origin, link_name, force=False):
|
||||
|
@ -43,7 +44,13 @@ def symlink(model_path, link_name, force):
|
|||
elif link_path.exists():
|
||||
link_path.unlink()
|
||||
|
||||
link_path.symlink_to(model_path)
|
||||
if sys.version.startswith('2.') and sys.platform.startswith('win'):
|
||||
import subprocess
|
||||
subprocess.call(['mklink','/d',str(link_path), str(model_path)],
|
||||
shell=True)
|
||||
else:
|
||||
link_path.symlink_to(model_path)
|
||||
|
||||
util.print_msg(
|
||||
"{a} --> {b}".format(a=model_path.as_posix(), b=link_path.as_posix()),
|
||||
"You can now load the model via spacy.load('{l}').".format(l=link_name),
|
||||
|
|
Loading…
Reference in New Issue
Block a user