FunASR 部署
FunASR希望在语音识别的学术研究和工业应用之间架起一座桥梁。
通过发布工业级语音识别模型的训练和微调,研究人员和开发人员可以更方便地进行语音识别模型的研究和生产,并推动语音识别生态的发展。让语音识别更有趣!
参考:FunASR
安装
pip3 install -U funasr -i https://pypi.tuna.tsinghua.edu.cn/simple
测试
funasr ++model=paraformer-zh ++vad_model="fsmn-vad" ++punc_model="ct-punc" ++input=~/.cache/modelscope/hub/iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online/example/asr_example.wav
funasr version: 1.1.6.
Check update of funasr, and it would cost few times. You may disable it by set `disable_update=True` in AutoModel
You are using the latest version of funasr-1.1.6
...
[{'key': 'asr_example', 'text': '欢迎大家来体验达摩院推出的语音识别模型。', 'timestamp': [[880, 1120], [1120, 1360], [1380, 1540], [1540, 1780], [1780, 2020], [2020, 2180], [2180, 2420], [2480, 2600], [2600, 2780], [2780, 3020], [3040, 3240], [3240, 3480], [3480, 3700], [3700, 3900], [3900, 4140], [4180, 4420], [4420, 4620], [4620, 4780], [4780, 5195]]}]
实时语音 CPU
参考:FunASR实时语音听写服务开发指南
docker pull registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.10
mkdir -p ./funasr-runtime-resources/models
docker run -p 10096:10095 -it --privileged=true -v $PWD/funasr-runtime-resources/models:/workspace/models registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.10cd FunASR/runtime
cat test.sh
nohup bash run_server_2pass.sh \--download-model-dir /workspace/models \--vad-dir damo/speech_fsmn_vad_zh-cn-16k-common-onnx \--model-dir damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx \--online-model-dir damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online-onnx \--punc-dir damo/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727-onnx \--lm-dir damo/speech_ngram_lm_zh-cn-ai-wesp-fst \--itn-dir thuduj12/fst_itn_zh \--hotword /workspace/models/hotwords.txt > log.txt 2>&1 &
root@2bf110b5e876:/workspace/FunASR/runtime# cat log.txtchmod +x test.sh && ./test.sh
客户端
参考:FunASR实时语音听写便捷部署教程