modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
6.99k stars 744 forks source link

Add bounds check for postprocess_utils.py abbr_dispose() #2209

Closed BitSteve closed 3 days ago

BitSteve commented 4 days ago

Trying to run this example for speech_timestamp_prediction-v1-16k-offline here for different audios. I see my English audio failed with this error. Added this extra check locally and solved the issue.

"/Users/{USER}/.pyenv/versions/funasr_usage/lib/python3.12/site-packages/funasr/utils/postprocess_utils.py", line 127, in abbr_dispose
    end = time_stamp[ts_nums[num]][1]
          ~~~~~~~~~~^^^^^^^^^^^^^^
IndexError: list index out of range