Browse Source

check wenetruntime

master^2
pengzhendong 2 years ago
parent
commit
02d2469e55
3 changed files with 12 additions and 2 deletions
  1. +5
    -0
      modelscope/utils/error.py
  2. +7
    -0
      modelscope/utils/import_utils.py
  3. +0
    -2
      requirements/audio.txt

+ 5
- 0
modelscope/utils/error.py View File

@@ -70,6 +70,11 @@ PYTORCH_IMPORT_ERROR = """
installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
"""

WENETRUNTIME_IMPORT_ERROR = """
{0} requires the wenetruntime library but it was not found in your environment. You can install it with pip:
`pip install wenetruntime==TORCH_VER`
"""

# docstyle-ignore
SCIPY_IMPORT_ERROR = """
{0} requires the scipy library but it was not found in your environment. You can install it with pip:


+ 7
- 0
modelscope/utils/import_utils.py View File

@@ -245,6 +245,10 @@ def is_torch_cuda_available():
return False


def is_wenetruntime_available():
return importlib.util.find_spec('wenetruntime') is not None


def is_tf_available():
return _tf_available

@@ -280,6 +284,9 @@ REQUIREMENTS_MAAPING = OrderedDict([
('timm', (is_timm_available, TIMM_IMPORT_ERROR)),
('tokenizers', (is_tokenizers_available, TOKENIZERS_IMPORT_ERROR)),
('torch', (is_torch_available, PYTORCH_IMPORT_ERROR)),
('wenetruntime',
(is_wenetruntime_available,
WENETRUNTIME_IMPORT_ERROR.replace('TORCH_VER', _torch_version))),
('scipy', (is_scipy_available, SCIPY_IMPORT_ERROR)),
('cv2', (is_opencv_available, OPENCV_IMPORT_ERROR)),
('PIL', (is_pillow_available, PILLOW_IMPORT_ERROR)),


+ 0
- 2
requirements/audio.txt View File

@@ -25,5 +25,3 @@ torchaudio
tqdm
ttsfrd>=0.0.3
unidecode
# wenetruntime version should be the same as torch
wenetruntime==1.11

Loading…
Cancel
Save