Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions vllm_omni/entrypoints/openai/serving_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1679,12 +1679,9 @@ def _create_audio_choice(
# OMNI: Access multimodal_output from CompletionOutput (outputs[0]), not from RequestOutput
# Reference: examples/offline_inference/qwen3_omni/end2end.py line 421
audio_data = final_res.outputs[0].multimodal_output.get("audio")
if stream:
audio_tensor = audio_data[-1].float().detach().cpu().numpy()
else:
if isinstance(audio_data, list):
audio_data = torch.cat(audio_data, dim=-1)
audio_tensor = audio_data.float().detach().cpu().numpy()
if isinstance(audio_data, list):
audio_data = torch.cat(audio_data, dim=-1)
Comment on lines +1682 to +1683

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve delta-only audio payloads in streaming mode

This change removes the stream-specific path and now always concatenates the full audio_data list, but in streaming responses _create_audio_choice(..., stream=True) is called for every emitted omni_res (see the loop around final_output_type == "audio"), and the output processor accumulates audio chunks in a growing list across emissions. As a result, each streamed chunk now contains all prior audio again instead of only the newest delta, which causes duplicated audio for clients that append deltas and makes payload size grow rapidly over long generations.

Useful? React with 👍 / 👎.

audio_tensor = audio_data.float().detach().cpu().numpy()

# Ensure audio is 1D (flatten if needed)
if audio_tensor.ndim > 1:
Expand Down