FunASR
FunASR copied to clipboard
model.generate时,推理一半出现了list out of range问题
🐛 Bug
When I execute model.generate() with an audio almost an hour, the error “list index out of range” appears.
To Reproduce
rtf_avg: 0.511: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.89s/it]
rtf_avg: 0.023: 50%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 1/2 [00:01<00:01, 1.05s/it]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.46it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.49it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.49it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.49it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.49it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.51it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.51it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.51it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.52it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.50it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.45it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.015: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.13it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.46it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.49it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.46it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.46it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.47it/s]
rtf_avg: 0.011: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.48it/sTraceback (most recent call last): | 0/1 [00:00<?, ?it/s]
File "/root/autodl-tmp/PunctuationModel-master/mel_txt_split.py", line 544, in <module>
txt_contents, spk_name = main(args)
File "/root/autodl-tmp/PunctuationModel-master/mel_txt_split.py", line 453, in main
text, timestamp, cleaned_text, cleaned_text_list = audio_asr(args.audio_path) # 带标点文本,单词时间戳,无标点文本
File "/root/autodl-tmp/PunctuationModel-master/mel_txt_split.py", line 275, in audio_asr
res = model.generate(input=audio_path,
File "/root/miniconda3/lib/python3.10/site-packages/funasr/auto/auto_model.py", line 218, in generate
return self.inference_with_vad(input, input_len=input_len, **cfg)
File "/root/miniconda3/lib/python3.10/site-packages/funasr/auto/auto_model.py", line 341, in inference_with_vad
results = self.inference(speech_j, input_len=None, model=model, kwargs=kwargs, **cfg)
File "/root/miniconda3/lib/python3.10/site-packages/funasr/auto/auto_model.py", line 251, in inference
res = model.inference(**batch, **kwargs)
File "/root/miniconda3/lib/python3.10/site-packages/funasr/models/seaco_paraformer/model.py", line 414, in inference
postprocess_utils.sentence_postprocess(token, timestamp)
File "/root/miniconda3/lib/python3.10/site-packages/funasr/utils/postprocess_utils.py", line 231, in sentence_postprocess
word_lists, ts_lists = abbr_dispose(word_lists, ts_lists)
File "/root/miniconda3/lib/python3.10/site-packages/funasr/utils/postprocess_utils.py", line 127, in abbr_dispose
begin = time_stamp[ts_nums[num]][0]
IndexError: list index out of range
Code sample
相关代码:
from funasr import AutoModel
model = AutoModel(model="paraformer-zh", model_revision="v2.0.4",
vad_model="fsmn-vad", vad_model_revision="v2.0.4",
punc_model="ct-punc-c", punc_model_revision="v2.0.4",
# spk_model="cam++", spk_model_revision="v2.0.2",
)
res = model.generate(input=audio_path,
batch_size_s=300,
hotword=hotword)
Environment
- OS (e.g., Linux): Linux
- FunASR Version (e.g., 1.0.0): 1.0.17
- ModelScope Version (e.g., 1.11.0): 1.13.1
- PyTorch Version (e.g., 2.0.0): 2.0.1
- How you installed funasr (
pip
, source): pip install funasr==1.0.17 - Python version: 3.10.8
- GPU (e.g., V100M32): 4090D
- CUDA/cuDNN version (e.g., cuda11.7): cuda 11.8 / cuDNN 8.6.0.163
- Docker version (e.g., funasr-runtime-sdk-cpu-0.4.1): None
- Any other relevant information:
Additional context
加载funasr的模型,对1个小时左右的音频执行generate方法,报错list index out of range,只有少部分音频是没问题的。但在本地用的python 3.8跑是没问题的
朋友,你找到原因了吗, 我也碰到类似的问题。本地ok,服务器上有问题。
你好,我已经收到来信,会尽快查看~
我也遇到了一样的问题, 如果把funasr版本降级到1.0.17就没有异常了.
我也遇到了一样的问题,请问有什么解决方案吗?
我在识别一句"答案是1.5"的音频时, 必然触发此异常. 实际上模型已经正确识别了该音频, 但是在后处理的时候好像和time stamp等内容没有严格对齐, 应该和1.5的后处理有关.
我在识别一句"答案是1.5"的音频时, 必然触发此异常. 实际上模型已经正确识别了该音频, 但是在后处理的时候好像和time stamp等内容没有严格对齐, 应该和1.5的后处理有关.
可以分享一下这句音频吗,我来修复一下
@R1ckShi 可以参考#1698 复现
看到了,那个后处理函数的问题我会修一下,这里先关掉了
看到了,那个后处理函数的问题我会修一下,这里先关掉了
您好,我想问一下这个问题解决了吗?