-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Issue Description (描述内容):
Describe the bug (问题描述) 在使用 funasr==1.3.1 时,如果开启 VAD 并使用 Fun-ASR-MLT-Nano-2512 模型进行推理,程序会崩溃并报 KeyError: 0。 When using funasr==1.3.1, the program crashes with KeyError: 0 if VAD is enabled and the Fun-ASR-MLT-Nano-2512 model is used for inference.
Environment (环境信息)
OS: Linux
Python version: 3.10
funasr version: 1.3.1
Model: FunAudioLLM/Fun-ASR-MLT-Nano-2512
Traceback (错误堆栈)
Traceback (most recent call last):
File "model_inference.py", line 177, in transcribe
res = self.model.generate(**generate_kwargs)
File "/.../python3.10/site-packages/funasr/auto/auto_model.py", line 329, in generate
return self.inference_with_vad(
File "/.../python3.10/site-packages/funasr/auto/auto_model.py", line 558, in inference_with_vad
t[0] += vadsegments[j][0]
KeyError: 0
Root Cause Analysis (根因分析) 在 funasr/auto/auto_model.py 的第 558 行,inference_with_vad 函数尝试合并 VAD 片段的时间戳: t[0] += vadsegments[j][0] 由于某些模型(如 MLT 系列)在 VAD 模式下返回的片段数据结构可能是字典(Dict)而非列表(List/Tuple),导致通过索引 [0] 访问时触发了 KeyError: 0。
In line 558 of funasr/auto/auto_model.py, the inference_with_vad function attempts to merge timestamps. For certain models like the MLT series, the segment structure might be a dictionary, causing the integer index [0] to fail.