FunAudioLLM / SenseVoice

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

ValueError: Key SenseVoiceEncoderSmall already exists in encoder_classes #160

Closed JinYuanZhang999 closed 2 weeks ago

JinYuanZhang999 commented 2 weeks ago

Notice: In order to resolve issues more efficiently, please raise issue following the template. (注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

What is your question?

I encountered an error when running the code in the demo2.py file (the inference part from the documentation): ValueError: Key SenseVoiceEncoderSmall already exists in encoder_classes.

Code

from model import SenseVoiceSmall from funasr.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall" m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir, device="cuda:0") m.eval()

res = m.inference( data_in=f"{kwargs['model_path']}/example/en.mp3", language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech" use_itn=False, ban_emo_unk=False, **kwargs, )

text = rich_transcription_postprocess(res[0][0]["text"]) print(text) QQ20241105-103353