#831 AssertionError: iic/SenseVoiceSmall is not registered

*120.47* Posted at: 5 hours ago 👁8

语音识别阶段出错:iic/SenseVoiceSmall is not registered[阿里FunASR中文(本地)]:

Traceback (most recent call last):

File "videotrans\task\job.py", line 97, in run

File "videotrans\task\_speech2text.py", line 93, in recogn

File "videotrans\recognition\__init__.py", line 227, in run

File "videotrans\recognition\_base.py", line 70, in run

File "videotrans\recognition\_funasr.py", line 61, in _exec

File "videotrans\recognition\_funasr.py", line 103, in _exec1

File "funasr\auto\auto_model.py", line 125, in __init__

model, kwargs = self.build_model(kwargs)

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

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

AssertionError: iic/SenseVoiceSmall is not registered

=====

Windows-10-10.0.22631-SP0

version:v3.80

frozen:True

language:zh

1 Replies

本条内容由 DeepSeek 回复
这个错误是由于阿里FunASR语音识别模型 iic/SenseVoiceSmall 未正确注册导致的,常见于源码部署环境。这是一个已知的PySide6与ModelScope懒加载机制冲突问题。

解决方案:

你需要修改ModelScope的源码文件来解决这个注册问题:

1. 找到文件:[你的Python环境]/lib/site-packages/modelscope/utils/import_utils.py

2. 打开该文件,找到 LazyImportModule 类的 __getattr__ 方法

3. 在该方法的最开头添加以下代码:

def __getattr__(self, name: str) -> Any:
    # ==================== 补丁 ====================
    # 当PySide6的底层检查'__wrapped__'属性时,
    # 我们直接告诉它"没有这个属性",而不是触发危险的懒加载。
    if name == '__wrapped__':
        raise AttributeError
    # ==================== 补丁结束 ====================

4. 保存文件后重启软件即可正常使用阿里FunASR语音识别功能。

替代方案:

如果修改源码对你来说太复杂,可以暂时切换到其他语音识别渠道,如:

  • faster-whisper本地模式
  • 字节火山字幕生成
  • 阿里Qwen3-ASR语音识别

这些渠道同样对中文有很好的识别效果,且不会遇到此注册问题。

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.

Donate: https://ko-fi.com/jianchang512

Trending Questions