From 2160873f98c190a7ec7f45dc8ea7623be8bf8396 Mon Sep 17 00:00:00 2001
From: lyblsgo <wucong.lyb@alibaba-inc.com>
Date: 星期三, 08 十一月 2023 15:36:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/main'

---
 funasr/version.txt                                       |    2 +-
 runtime/python/onnxruntime/funasr_onnx/paraformer_bin.py |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/funasr/version.txt b/funasr/version.txt
index 100435b..ee94dd8 100644
--- a/funasr/version.txt
+++ b/funasr/version.txt
@@ -1 +1 @@
-0.8.2
+0.8.3
diff --git a/runtime/python/onnxruntime/funasr_onnx/paraformer_bin.py b/runtime/python/onnxruntime/funasr_onnx/paraformer_bin.py
index 71cf434..7b13654 100644
--- a/runtime/python/onnxruntime/funasr_onnx/paraformer_bin.py
+++ b/runtime/python/onnxruntime/funasr_onnx/paraformer_bin.py
@@ -36,7 +36,6 @@
                  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
@@ -242,6 +241,13 @@
 
         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:
                 raise "model_dir must be model_name in modelscope or local path downloaded from modelscope, but is {}".format(model_dir)

--
Gitblit v1.9.1