游雁 2 лет назад
Родитель
Сommit
7e123e198b
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      funasr/runtime/python/onnxruntime/funasr_onnx/utils/utils.py

+ 5 - 2
funasr/runtime/python/onnxruntime/funasr_onnx/utils/utils.py

@@ -9,8 +9,11 @@ from typing import Any, Dict, Iterable, List, NamedTuple, Set, Tuple, Union
 import re
 import numpy as np
 import yaml
-from onnxruntime import (GraphOptimizationLevel, InferenceSession,
-                         SessionOptions, get_available_providers, get_device)
+try:
+    from onnxruntime import (GraphOptimizationLevel, InferenceSession,
+                             SessionOptions, get_available_providers, get_device)
+except:
+    print("please pip3 install onnxruntime")
 import jieba
 import warnings