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

运行demo2.py,报错:IndexError: index 2 is out of bounds for dimension 1 with size 2 #183

Open
JosenJin opened this issue Jan 18, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@JosenJin
Copy link

运行demo2.py,报错:

SenseVoice\utils\ctc_alignment.py", line 50, in ctc_forced_align
best_score[:, padding_num + 0] = log_probs[:, 0, blank]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
IndexError: index 2 is out of bounds for dimension 1 with size 2

@JosenJin JosenJin added the bug Something isn't working label Jan 18, 2025
@JosenJin
Copy link
Author

根据https://github.com/clarin-ebtio800090/FunAudioLLM-SenseVoice-183/commit/aa651c9d33fbc65151ae6b20e640a3e2d22d7ee7.修改后,仍然报错

\ctc_alignment.py", line 50, in ctc_forced_align
best_score[:, padding_num] = log_probs[:, 0, blank]
~~~~~~~~~~^^^^^^^^^^^^^^^^
IndexError: index 1 is out of bounds for dimension 1 with size 1

@JosenJin
Copy link
Author

padding_num = 1
padded_t = padding_num + _t_a_r_g_e_t_s_.size(-1)
best_score = torch.full((batch_size, padded_t), neg_inf, device=log_probs.device, dtype=log_probs.dtype)
best_score[:, padding_num] = log_probs[:, 0, blank]
best_score[:, padding_num + 1] = log_probs[bsz_indices, 0, _t_a_r_g_e_t_s_[:, 0]]

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
@JosenJin and others