FunAudioLLM/SenseVoiceSmall
48324k
1from funasr import AutoModel2from funasr.utils.postprocess_utils import rich_transcription_postprocess3 4model_dir = "FunAudioLLM/SenseVoiceSmall"5 6 7model = AutoModel(8 model=model_dir,9 vad_model="fsmn-vad",10 vad_kwargs={"max_single_segment_time": 30000},11 device="cuda:0",12 hub="hf",13)14 15# en16res = model.generate(17 input=f"{model.model_path}/example/en.mp3",18 cache={},19 language="auto", # "zn", "en", "yue", "ja", "ko", "nospeech"20 use_itn=True,21 batch_size_s=60,22 merge_vad=True, #23 merge_length_s=15,24)25text = rich_transcription_postprocess(res[0]["text"])26print(text)27 28 