from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
inference_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model='damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch',
model_revision="v1.2.4")
rec_result = inference_pipeline(audio_in='1_combined.wav')
print(rec_result)
我在容器里运行这个。
docker run -it \
-v $PWD/funasr-runtime-resources/models:/root/.cache/modelscope/hub \
-v $PWD/test:/app/test \
funasr-base:latest /bin/bash
modelscope-funasr启动时挂载了本地下载好的model ,怎么运行脚本后 还在下载呢? 怎么看本地下载的是什么版本? 是路径挂载的不对吗?
路径挂载模型默认是给c++ runtime用的,所以pipeline会重复下载模型,想要复用模型,路径设置为本地路径,model='/workspace/models/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch'。此回答整理自钉群“modelscope-funasr社区交流”