#546 RuntimeError: paraformer-zh is not registered

*36f:9b9* Posted at: 4 hours ago 👁12

Error in speech recognition:paraformer-zh is not registered[FunASR-Chinese]:

Traceback (most recent call last):

File "/home/shapo/Git/pyvideotrans/videotrans/task/trans_create.py", line 375, in recogn

raw_subtitles = run_recogn(

recogn_type=self.cfg['recogn_type'],

......

target_code=self.cfg['target_language_code'] if self.shoud_trans else None,

inst=self)

File "/home/shapo/Git/pyvideotrans/videotrans/recognition/__init__.py", line 227, in run

return FunasrRecogn(kwargs).run()

~~~~~~~~~~~~~~~~~~~~~~~~~~^^

File "/home/shapo/Git/pyvideotrans/videotrans/recognition/_base.py", line 70, in run

return self._exec()

~~~~~~~~~~^^

File "/home/shapo/Git/pyvideotrans/videotrans/recognition/_funasr.py", line 64, in _exec

model = AutoModel(

model=self.model_name, model_revision="v2.0.4",

......

device=self.device

)

File "/home/shapo/.virtualenvs/whisper/lib/python3.13/site-packages/funasr/auto/auto_model.py", line 125, in __init__

model, kwargs = self.build_model(kwargs)

~~~~~~~~~~~~~~~~^^^^^^^^^^

File "/home/shapo/.virtualenvs/whisper/lib/python3.13/site-packages/funasr/auto/auto_model.py", line 264, in build_model

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

^^^^^^^^^^^^^^^^^^^^^^^

AssertionError: paraformer-zh is not registered

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/shapo/Git/pyvideotrans/videotrans/task/job.py", line 97, in run

trk.recogn()

~~~~~~~~~~^^

File "/home/shapo/Git/pyvideotrans/videotrans/task/trans_create.py", line 411, in recogn

raise RuntimeError(msg)

RuntimeError: paraformer-zh is not registered

=====

Linux-6.16.7-arch1-1-x86_64-with-glibc2.42

version:v3.80

frozen:False

language:en

3 Replies

Admin

查看这个解释 https://pyvideotrans.com/blog/paraformer-zh-is-not-registered

简单来说就是PySide6的一个内部自检行为,和ModelScope的懒加载机制冲突,需要修改 modelscope 源码

image

Admin

Simply put, it is an internal self-check behavior of PySide6, which conflicts with the lazy loading mechanism of ModelScope, and the modelscope source code needs to be modified.

venv/python3.10/lib/site-packages/modelscope/utils/import_utils.py

class LazyImportModule(ModuleType):
    # ... ...
    def __getattr__(self, name: str) -> Any:
        # start add new code
        if name == '__wrapped__':
            raise AttributeError
        # end add new code

谢谢,已经解决

Post Your Reply

Trending Questions