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
batch
游雁f57b68121a52
diff --git a/funasr/models/sense_voice/model.py b/funasr/models/sense_voice/model.pyindex ae20902cf..d06776b40 100644--- a/funasr/models/sense_voice/model.py+++ b/funasr/models/sense_voice/model.py@@ -310,6 +310,7 @@ class SenseVoiceRWKV(nn.Module):speech_lengths = speech_lengths[:, 0]batch_size, frames, _ = speech.shape+ _, text_tokens = text.shapeif self.activation_checkpoint:from torch.utils.checkpoint import checkpoint@@ -331,6 +332,10 @@ class SenseVoiceRWKV(nn.Module):stats["batch_size_x_frames"] = frames * batch_sizestats["batch_size_real_frames"] = speech_lengths.sum().item()stats["padding_frames"] = stats["batch_size_x_frames"] - stats["batch_size_real_frames"]+ stats["batch_size_x_tokens"] = text_tokens * batch_size+ stats["batch_size_real_tokens"] = text_lengths.sum().item()+ stats["padding_tokens"] = stats["batch_size_x_tokens"] - stats["batch_size_real_tokens"]+ stats["batch_size_x_frames_plus_tokens"] = (text_tokens + frames) * batch_size# force_gatherable: to-device and to-tensor if scalar for DataParallelif self.length_normalized_loss: