返回模型
说明文档
介绍
本仓库克隆自 https://huggingface.co/funasr/Paraformer-large
安装 funasr_onnx
pip install -U funasr_onnx
# 中国用户可以使用以下命令安装:
# pip install -U funasr_onnx -i https://mirror.sjtu.edu.cn/pypi/web/simple
下载模型
git clone https://huggingface.co/hoangus0303/paraformer-large-clone-from-funasr
使用运行时进行推理
语音识别
Paraformer
from funasr_onnx import Paraformer
model_dir = \"./paraformer-large\"
model = Paraformer(model_dir, batch_size=1, quantize=True)
wav_path = ['./funasr/paraformer-large/asr_example.wav']
result = model(wav_path)
print(result)
model_dir: 模型路径,包含model.onnx、config.yaml、am.mvnbatch_size:1(默认值),推理时的批处理大小device_id:-1(默认值),在 CPU 上推理。如果要使用 GPU 推理,请设置为 gpu_id(请确保已安装 onnxruntime-gpu)quantize:False(默认值),加载model_dir中的model.onnx模型。如果设置为True,则加载model_dir中的model_quant.onnx模型intra_op_num_threads:4(默认值),设置 CPU 上算子内并行所使用的线程数
输入: wav 格式文件,支持的格式: str, np.ndarray, List[str]
输出: List[str]: 识别结果
hoangus0303/paraformer-large-clone-from-funasr
作者 hoangus0303
automatic-speech-recognition
↓ 1
♥ 0
创建时间: 2025-02-22 02:25:44+00:00
更新时间: 2025-02-22 02:29:15+00:00
在 Hugging Face 上查看文件 (8)
.gitattributes
README.md
am.mvn
asr_example.wav
config.yaml
model_quant.onnx
ONNX
struct.png
tokens.json