modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
6.5k stars 689 forks source link

在离线环境下无法加载asr模型? #1098

Closed xuhongtian closed 11 months ago

xuhongtian commented 11 months ago

os:python3.9的 modelscope=1.9.4 funasr=0.8.4,torch=2.0.1. inference_pipline = pipeline(task=Tasks.auto_speech_recognition,model="/data/asr_model/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch") 本地configuration.json配置 { "framework": "pytorch", "task" : "auto-speech-recognition", "model" : { "type" : "generic-asr", "am_model_name" : "model.pb", "model_config" : { "type": "pytorch", "code_base": "funasr", "mode": "paraformer", "lang": "zh-cn", "batch_size": 1, "am_model_config": "config.yaml", "asr_model_config": "decoding.yaml", "mvn_file": "am.mvn", "model":"/data/asr_model/peech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch", "lm_model": "/data/asr_model/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch" } }, "pipeline": { "type":"asr-inference" } } 333 我的配置文件应该均已下载到本地,列表如下 222 请问下这是什么问题?

LauraGPT commented 11 months ago

Firstly, you should not change the model names in the configuration.json.

Secondly, you just set the model name to the local path. docs

Lastly, the paraformer-long model contains asr, vad, punc models. You should set them all to local path. demo

xuhongtian commented 10 months ago

按照你提供的https://alibaba-damo-academy.github.io/FunASR/en/modelscope_pipeline/quick_start_zh.html#id9,我在本地服务器进行模型下载和适配,还是依然存在服务器无法加载离线模型。 code: from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks

modelpath = "/data/modelscope_bak/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch" asr_pipeline = pipeline(task=Tasks.auto_speech_recognition,model=modelpath) wav_name = "2023110200000949.wav" asr_result = asr_pipeline(audio_in=wav_name) print(asr_result) 模型存放本地地址如下:

模型地址

config配置如下

configuration配置

发现依然存在模型启动后还是会默认去读取cache,从而无法首先读取本地模型。