Repository navigation
fix list index out of range error - #2122
Merged
Merged
Conversation
4 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
list index out of range case 1:
2024-10-08T15:04:42.378018915+08:00 INFO:logger:Traceback (most recent call last):
2024-10-08T15:04:42.378026694+08:00 File "app.py", line 387, in pipeline
2024-10-08T15:04:42.378030230+08:00 reg = step1_asr(media_url)
2024-10-08T15:04:42.378033100+08:00 File "app.py", line 120, in step1_asr
2024-10-08T15:04:42.378035860+08:00 res = asr_model.generate(filename)
2024-10-08T15:04:42.378038943+08:00 File "/usr/local/services/asr/src/asr_model.py", line 371, in generate
2024-10-08T15:04:42.378041871+08:00 return self.inference_with_vad(input, input_len=input_len, **cfg)
2024-10-08T15:04:42.378045201+08:00 File "/usr/local/services/asr/src/asr_model.py", line 534, in inference_with_vad
2024-10-08T15:04:42.378048683+08:00 results = self.inference(
2024-10-08T15:04:42.378054236+08:00 File "/usr/local/services/asr/src/asr_model.py", line 411, in inference
2024-10-08T15:04:42.378057447+08:00 res = model.inference(**batch, **kwargs, cache={}) #nixon
2024-10-08T15:04:42.378060921+08:00 File "/usr/local/lib/python3.8/site-packages/funasr/models/seaco_paraformer/model.py", line 489, in inference
2024-10-08T15:04:42.378063817+08:00 postprocess_utils.sentence_postprocess(token, timestamp)
2024-10-08T15:04:42.378066886+08:00 File "/usr/local/lib/python3.8/site-packages/funasr/utils/postprocess_utils.py", line 247, in sentence_postprocess
2024-10-08T15:04:42.378069820+08:00 word_lists, ts_lists = abbr_dispose(word_lists, ts_lists)
2024-10-08T15:04:42.378072971+08:00 File "/usr/local/lib/python3.8/site-packages/funasr/utils/postprocess_utils.py", line 141, in abbr_dispose
2024-10-08T15:04:42.378075885+08:00 begin = time_stamp[ts_nums[num]][0]
2024-10-08T15:04:42.378078787+08:00 IndexError: list index out of range
list index out of range case 2:
File "/usr/local/lib/python3.8/site-packages/funasr/utils/timestamp_tools.py", line 93, in ts_prediction_lfr6_standar
timestamp_list[-1][1] = num_frames * TIME_RATE
IndexError: list index out of range
timestamp_list 可能为空