#3633 阿里asr本地 调用fun-asr-nano-2512报错

39.144* Posted at: 2 hours ago 👁7

语音识别阶段出错 [阿里FunASR(本地)] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 898, in funasr_mlt
File "funasr\auto\auto_model.py", line 135, in init

model, kwargs = self.build_model(**kwargs)

File "funasr\auto\auto_model.py", line 281, in build_model

assert model_class is not None, f'{kwargs["model"]} is not registered'

AssertionError: FunASRNano is not registered

Traceback (most recent call last):
File "videotrans\task\job.py", line 105, in run
File "videotrans\task\_speech2text.py", line 152, in recogn
File "videotrans\recognition\__init__.py", line 242, in run
File "videotrans\recognition\_base.py", line 143, in run
File "videotrans\recognition\_funasr.py", line 64, in _exec
File "videotrans\configure\_base.py", line 288, in _new_process
RuntimeError: Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 898, in funasr_mlt
File "funasr\auto\auto_model.py", line 135, in init

model, kwargs = self.build_model(**kwargs)

File "funasr\auto\auto_model.py", line 281, in build_model

assert model_class is not None, f'{kwargs["model"]} is not registered'

AssertionError: FunASRNano is not registered
TaskCfgSTT(is_cuda=True, uuid='88ffe04a26', cache_folder='D:/soft/AI/win-pyvideotrans-v3.98-314/tmp/20972/88ffe04a26', target_dir='D:/soft/AI/win-pyvideotrans-v3.98-314/output/recogn', source_language=None, source_language_code=None, source_sub=None, source_wav=None, source_wav_output=None, target_language=None, target_language_code=None, target_sub='D:/soft/AI/win-pyvideotrans-v3.98-314/output/recogn/1.srt', target_wav=None, target_wav_output=None, name='D:/1.mp4', noextname='1', basename='1.mp4', ext='mp4', dirname='D:/', shound_del_name=None, detect_language='zh-cn', recogn_type=3, model_name='Fun-ASR-Nano-2512', shibie_audio='D:/soft/AI/win-pyvideotrans-v3.98-314/tmp/20972/88ffe04a26/1-1773635441.0307183.wav', remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=False)

3 Replies

这是由于 FunASR 本地模型未正确注册或版本不兼容导致的。

  1. 请确保你使用的是 v3.98 或更高版本的 pyVideoTrans。早期版本可能不支持此模型。
  2. 如果已是最新版本,请尝试在软件中切换为其他 FunASR 模型(如 paraformer-zhparaformer-zh-streaming)进行测试。
  3. 如果问题依旧,可能是模型缓存损坏。请尝试清理模型缓存:

    • 关闭软件。
    • 进入软件安装目录下的 models 文件夹。
    • 删除与 funasrmodelscope 相关的文件夹(例如 funasriic 等)。
    • 重新启动软件,它会自动重新下载模型。

如果上述步骤无法解决问题,请提供软件安装目录下 logs 文件夹中最新日志文件的底部约30行报错信息,以便进一步分析。

请查阅相关文档:

我要用这个模型怎么解决呢 fun-asr-nano-2512

要使用 fun-asr-nano-2512 模型,你需要手动下载并放置到正确的目录,因为软件可能没有自动下载或注册该模型。

  1. 下载模型文件

    • 访问模型下载地址:https://www.modelscope.cn/models/iic/funasr_nano-zh-cn-16k-common-vad-punc_asr_nat-zh-cn-16k-common-vad-punc-2512/files
    • 下载该页面中的所有文件(通常包括 .bin, .json, .txt 等)。
  2. 创建并放置模型文件夹

    • 在 pyVideoTrans 软件根目录下,找到 models 文件夹。
    • models 文件夹内,创建一个名为 iic__funasr_nano-zh-cn-16k-common-vad-punc_asr_nat-zh-cn-16k-common-vad-punc-2512 的新文件夹。
    • 将第一步下载的所有文件复制到这个新创建的文件夹中。
  3. 重启软件并测试

    • 重新启动 pyVideoTrans。
    • 在语音识别渠道中选择“阿里FunASR(本地)”。
    • 在模型下拉列表中,应该能看到并选择 fun-asr-nano-2512 模型。
    • 再次尝试语音识别。

如果问题依旧,请检查软件版本是否为 v3.98 或更高。如果版本过低,请升级。如果已是最新版本且手动放置模型后仍报错,可能是模型文件不完整或软件内部调用方式有变。此时,建议暂时切换到其他 FunASR 模型(如 paraformer-zh)完成工作,或提供最新的日志文件以便进一步排查。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource