FunASR
FunASR copied to clipboard
离线环境下无法启动语音识别模型问题?(Unable to start the speech recognition model in an offline environment)
OS: linux
Python 3.10
Package: pytorch 1.13.1 、modelscope1.3.0 funasr 0.3.0
Model: auto-speech-recognition
Command:
inference_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model=params["model_dir"],
model_revision="v1.2.1",
vad_model='damo/speech_fsmn_vad_zh-cn-16k-common-pytorch',
vad_model_revision="v1.1.8",
punc_model='damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch',
punc_model_revision="v1.1.6",
batch_size=64,
)
Error log:
我是本地环境下进行模型加载,本机能连接公网情况下,是能正常启动模型的,显示如下
但是在不能连接公网的服务器下,却启动不了,问题如下
这里显示的还需要连接modelscope社区官网,我的配置文件应该均已下载到本地,列表如下
请问这个问题应该怎么解决?
模型下载到本地之后,把configuration.json中的路径dama/xxxxxxx 改成 ./xxxxx
Sorry, it is a bug. We will fix it by 20, Sept.
@funasr 你好,请问问题修复了吗?是否有直接关掉下载选项,载入本地模型的设置?
请问问题修复了吗,是否可以用内网训练模型了呢?
修复了吗
We have fixed this bug. Please update modelscope-1.9.2
pip install -U modescope>=1.9.2
我已经解决这个问题了,还是模型路径设置的问题:
funasr_wss_server.py 中,把所有AutoModel的model 都按照如下格式修改即可:
parser.add_argument(
"--asr_model",
type=str,
default=r"~/.cache/modelscope/hub/iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
help="model from modelscope",
)
# 确保路径正确解析
asr_model_path = os.path.expanduser(args.asr_model)
# 转换路径分隔符为 Windows 格式
asr_model_path = asr_model_path.replace('/', '\\')
print("asr_model_path:",asr_model_path)
model_asr = AutoModel(
model=asr_model_path,
model_revision=args.asr_model_revision,
ngpu=args.ngpu,
ncpu=args.ncpu,
device=args.device,
disable_pbar=True,
disable_log=True,
update_model=False,
)