Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

batch

游雁b512846c2ca0
diff --git a/funasr/models/sense_voice/model.py b/funasr/models/sense_voice/model.py
index 07fb4eb58..ae20902cf 100644
--- a/funasr/models/sense_voice/model.py
+++ b/funasr/models/sense_voice/model.py
@@ -329,6 +329,8 @@ class SenseVoiceRWKV(nn.Module):
stats["loss"] = torch.clone(loss.detach())
stats["batch_size"] = batch_size
stats["batch_size_x_frames"] = frames * batch_size
+ stats["batch_size_real_frames"] = speech_lengths.sum().item()
+ stats["padding_frames"] = stats["batch_size_x_frames"] - stats["batch_size_real_frames"]
# force_gatherable: to-device and to-tensor if scalar for DataParallel
if self.length_normalized_loss: