Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
Update model.py to fix "IndexError: index 1 is out of bounds for dimension 1 with size 0" (#2454)
Isuxiz Slidder3df109adfcce
diff --git a/funasr/models/sense_voice/model.py b/funasr/models/sense_voice/model.pyindex bd1c76dbc..c5d0e59ee 100644--- a/funasr/models/sense_voice/model.py+++ b/funasr/models/sense_voice/model.py@@ -925,6 +925,11 @@ class SenseVoiceSmall(nn.Module):if tok_ls: token_ids.extend(tok_ls)else: token_ids.append(124)+ if len(token_ids) == 0:+ result_i = {"key": key[i], "text": text}+ results.append(result_i)+ continue+logits_speech = self.ctc.softmax(encoder_out)[i, 4 : encoder_out_lens[i].item(), :]pred = logits_speech.argmax(-1).cpu()logits_speech[pred == self.blank_id, self.blank_id] = 0