Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

后处理会抛IndexError异常 #1698

Open
yzmyyff opened this issue May 7, 2024 · 0 comments
Open

后处理会抛IndexError异常 #1698

yzmyyff opened this issue May 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@yzmyyff
Copy link

yzmyyff commented May 7, 2024

Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

🐛 Bug

某些情况后处理会抛IndexError异常

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. Run cmd '....'
from funasr.utils import postprocess_utils

token = ['答', '案', '是', '1', '.', '5']

timestamp = [[190, 370], [370, 490], [490, 730], [790, 950],
                     [950, 1110], [1110, 1495]]

postprocess_utils.sentence_postprocess(token, timestamp)
  1. See error
Traceback (most recent call last):
  File "/data/vjuicefs_speech_tts_v3/11146693/gitlab/testset_exception/tests.py", line 24, in test_funasr
    postprocess_utils.sentence_postprocess(token, timestamp)
  File "/data/vjuicefs_speech_tts_v3/11146693/github/FunASR/funasr/utils/postprocess_utils.py", line 235, in sentence_postprocess
    word_lists, ts_lists = abbr_dispose(word_lists, ts_lists)
  File "/data/vjuicefs_speech_tts_v3/11146693/github/FunASR/funasr/utils/postprocess_utils.py", line 131, in abbr_dispose
    begin = time_stamp[ts_nums[num]][0]
IndexError: list index out of range

Code sample

Expected behavior

没有异常

Environment

  • OS (e.g., Linux): Linux
  • FunASR Version (e.g., 1.0.0): main head
  • ModelScope Version (e.g., 1.11.0): 1.13.3
  • PyTorch Version (e.g., 2.0.0):
  • How you installed funasr (pip, source): source.
  • Python version: 2.2.1+cu118
  • GPU (e.g., V100M32): L40s
  • CUDA/cuDNN version (e.g., cuda11.7): 11.8
  • Docker version (e.g., funasr-runtime-sdk-cpu-0.4.1)
  • Any other relevant information:

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants