FunASR icon indicating copy to clipboard operation
FunASR copied to clipboard

离线环境下无法启动语音识别模型问题?(Unable to start the speech recognition model in an offline environment)

Open ljazbtzv99936 opened this issue 1 year ago • 6 comments

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: 我是本地环境下进行模型加载,本机能连接公网情况下,是能正常启动模型的,显示如下 image 但是在不能连接公网的服务器下,却启动不了,问题如下 image 这里显示的还需要连接modelscope社区官网,我的配置文件应该均已下载到本地,列表如下 image 请问这个问题应该怎么解决?

ljazbtzv99936 avatar Aug 31 '23 02:08 ljazbtzv99936

模型下载到本地之后,把configuration.json中的路径dama/xxxxxxx 改成 ./xxxxx

Dalaoyel avatar Aug 31 '23 03:08 Dalaoyel

Sorry, it is a bug. We will fix it by 20, Sept.

LauraGPT avatar Sep 01 '23 14:09 LauraGPT

@funasr 你好,请问问题修复了吗?是否有直接关掉下载选项,载入本地模型的设置?

kli017 avatar Sep 12 '23 06:09 kli017

请问问题修复了吗,是否可以用内网训练模型了呢?

Change0028 avatar Sep 18 '23 08:09 Change0028

修复了吗

Amazing-J avatar Sep 20 '23 02:09 Amazing-J

We have fixed this bug. Please update modelscope-1.9.2 pip install -U modescope>=1.9.2

LauraGPT avatar Oct 11 '23 01:10 LauraGPT

我已经解决这个问题了,还是模型路径设置的问题:

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,
)

qianbaidu1266 avatar Jul 11 '24 09:07 qianbaidu1266