Skip to content

Commit

Permalink
update contextual export
Browse files Browse the repository at this point in the history
  • Loading branch information
R1ckShi committed Nov 8, 2023
1 parent 323e43b commit 4a04c02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/python/onnxruntime/funasr_onnx/paraformer_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(self, model_dir: Union[str, Path] = None,
intra_op_num_threads: int = 4,
cache_dir: str = None
):

if not Path(model_dir).exists():
try:
from modelscope.hub.snapshot_download import snapshot_download
Expand Down Expand Up @@ -241,6 +240,13 @@ def __init__(self, model_dir: Union[str, Path] = None,
):

if not Path(model_dir).exists():
try:
from modelscope.hub.snapshot_download import snapshot_download
except:
raise "You are exporting model from modelscope, please install modelscope and try it again. To install modelscope, you could:\n" \
"\npip3 install -U modelscope\n" \
"For the users in China, you could install with the command:\n" \
"\npip3 install -U modelscope -i https://mirror.sjtu.edu.cn/pypi/web/simple"
try:
model_dir = snapshot_download(model_dir, cache_dir=cache_dir)
except:
Expand Down

0 comments on commit 4a04c02

Please sign in to comment.