FunAudioLLM / SenseVoice

Multilingual Voice Understanding Model
https://funaudiollm.github.io/
Other
2.62k stars 250 forks source link

An error occurs in the demo1.py code. Please help. #52

Closed CHK-0000 closed 1 month ago

CHK-0000 commented 2 months ago

New version available: 1.1.2. Your current version is 1.1.1. Please use the command "pip install -U funasr" to upgrade. 2024-07-16 21:34:04,960 - modelscope - INFO - PyTorch version 2.3.1+cu118 Found. 2024-07-16 21:34:04,962 - modelscope - INFO - Loading ast index from C:\Users\user.cache\modelscope\ast_indexer 2024-07-16 21:34:05,060 - modelscope - INFO - Loading done! Current index file version is 1.15.0, with md5 86c1ab7265caa4ace73adf359689f79a and a total number of 980 components indexed Download: iic/SenseVoiceSmall failed!: cannot import name 'PreTrainedModel' from 'transformers' (unknown location) Traceback (most recent call last): File "c:\SenseVoice\demo1.py", line 13, in model = AutoModel( File "c:\Users\user.conda\envs\test\lib\site-packages\funasr\auto\auto_model.py", line 124, in init model, kwargs = self.build_model(**kwargs) File "c:\Users\user.conda\envs\test\lib\site-packages\funasr\auto\auto_model.py", line 218, in build_model assert model_class is not None, f'{kwargs["model"]} is not registered' AssertionError: iic/SenseVoiceSmall is not registered

LauraGPT commented 2 months ago

Sorry, I have added two parameter:

    trust_remote_code=True,
    remote_code="./model.py",

You could update the code and try it again.

CHK-0000 commented 2 months ago

Is it possible to also categorize speakers in that repository code, and if so, what code can I use? Please elaborate.

LauraGPT commented 2 months ago

Is it possible to also categorize speakers in that repository code, and if so, what code can I use? Please elaborate.

So far, it only supports in zh. If you want to use it in zh, you could ref to https://github.com/modelscope/FunASR?tab=readme-ov-file#paraformer

CHK-0000 commented 2 months ago

from funasr import AutoModel

paraformer-zh is a multi-functional asr model

use vad, punc, spk or not as you need

model = AutoModel(model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc",

spk_model="cam++",

              )

res = model.generate(input=f"{model.model_path}/example/asr_example.wav", batch_size_s=300, hotword='魔搭') print(res)


Should I use this code?

LauraGPT commented 2 months ago

from funasr import AutoModel

paraformer-zh is a multi-functional asr model

use vad, punc, spk or not as you need

model = AutoModel(model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc", # spk_model="cam++", ) res = model.generate(input=f"{model.model_path}/example/asr_example.wav", batch_size_s=300, hotword='魔搭') print(res)

Should I use this code?

model = AutoModel(model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc", spk_model="cam++", )