[Bugfix] Fix MiniCPM-o 4.5 seeded turns and window E2E inputs (#8160)

Signed-off-by: Gao Han <hgaoaf@connect.ust.hk>
This commit is contained in:
Gao Han authored and GitHub committed 2026-09-26 01:42:53 +08:00
1 parent d31a2a3ba8
commit a8576ccb72
4 files changed
+72 -4

No files matched your search

@@ -202,6 +202,11 @@ class MiniCPMO45Stage0DuplexRuntime:
# Otherwise the turn-ended latch forces its silent input clock to
# listen before the model can answer. Generated content clears it.
state.pending_speech_context = True
# The seeded template already opens the assistant turn. Match
# that prefix in the native listen/speak state machine so silence
# advances this response until the model emits turn_eos.
state.current_turn_ended = False
state.pending_speech_response_open = True
def _stage_prefill_embeddings_only(
self,
@@ -989,9 +989,11 @@ class MiniCPMO45OmniForConditionalGeneration(nn.Module, SupportsMultiModal, Supp
with suppress(Exception):
state.pending_speech_response_open = False
return
# A seeded prefix can open the response before tts_bos is sampled.
# Keep its pending input until the first content token in either case.
if (
sampled == tts_bos_id
and getattr(state, "current_turn_ended", True)
and (getattr(state, "current_turn_ended", True) or getattr(state, "pending_speech_response_open", False))
and getattr(state, "pending_speech_context", False)
):
with suppress(Exception):