mirror of
https://github.com/modelscope/FunASR.git
synced 2026-10-12 02:19:18 +00:00
Add bounds check for postprocess_utils.py abbr_dispose() (#2209)
"/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
This commit is contained in:
@@ -122,7 +122,7 @@ def abbr_dispose(words: List[Any], time_stamp: List[List] = None) -> List[Any]:
|
||||
abbr_word += words[num].upper()
|
||||
num += 1
|
||||
word_lists.append(abbr_word)
|
||||
if time_stamp is not None:
|
||||
if time_stamp is not None and ts_nums[num] < len(time_stamp):
|
||||
end = time_stamp[ts_nums[num]][1]
|
||||
ts_lists.append([begin, end])
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user