소스 검색

export model

游雁 3 년 전
부모
커밋
1b5c15aa7c

+ 0 - 0
funasr/runtime/python/onnxruntime/paraformer/.gitignore → funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/.gitignore


+ 1 - 1
funasr/runtime/python/onnxruntime/paraformer/README.md → funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/README.md

@@ -10,7 +10,7 @@
 
 
 ### Steps:
-1. Download the whole directory (`funasr/runtime/python/onnxruntime`) to the local.
+1. Download the whole directory (`funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer`) to the local.
 2. Install the related packages.
    ```bash
    pip install requirements.txt

+ 1 - 1
funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/__init__.py

@@ -1,4 +1,4 @@
 # -*- encoding: utf-8 -*-
 # @Author: SWHL
 # @Contact: liekkaskono@163.com
-from .rapid_paraformer import RapidParaformer
+from .paraformer_onnx import Paraformer

+ 2 - 11
funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/paraformer_onnx.py

@@ -9,10 +9,10 @@ from typing import List, Union, Tuple
 import librosa
 import numpy as np
 
-from .utils import (CharTokenizer, Hypothesis, ONNXRuntimeError,
+from .utils.utils import (CharTokenizer, Hypothesis, ONNXRuntimeError,
                     OrtInferSession, TokenIDConverter, WavFrontend, get_logger,
                     read_yaml)
-from .postprocess_utils import sentence_postprocess
+from .utils.postprocess_utils import sentence_postprocess
 
 logging = get_logger()
 
@@ -140,12 +140,3 @@ class Paraformer():
         return text
 
 
-if __name__ == '__main__':
-    project_dir = Path(__file__).resolve().parent.parent
-    model_dir = "/home/zhifu.gzf/.cache/modelscope/hub/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"
-    model = Paraformer(model_dir)
-
-    wav_file = os.path.join(model_dir, 'example/asr_example.wav')
-    result = model(wav_file)
-    print(result)
-

+ 0 - 0
funasr/runtime/python/onnxruntime/paraformer/requirements.txt → funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/requirements.txt


+ 0 - 0
funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/__init__.py


+ 0 - 0
funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/postprocess_utils.py → funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/postprocess_utils.py


+ 1 - 1
funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils.py → funasr/runtime/python/onnxruntime/paraformer/rapid_paraformer/utils/utils.py

@@ -13,7 +13,7 @@ from onnxruntime import (GraphOptimizationLevel, InferenceSession,
                          SessionOptions, get_available_providers, get_device)
 from typeguard import check_argument_types
 
-from .kaldifeat import compute_fbank_feats
+from funasr.runtime.python.onnxruntime.paraformer.rapid_paraformer.kaldifeat import compute_fbank_feats
 import warnings
 
 root_dir = Path(__file__).resolve().parent