[Bugfix] Robust Audio Data Handling in _create_audio_choice#1222
[Bugfix] Robust Audio Data Handling in _create_audio_choice#1222LJH-LBJ wants to merge 1 commit intovllm-project:mainfrom
Conversation
Signed-off-by: Junhong Liu <98734602+LJH-LBJ@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73ee36b903
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if isinstance(audio_data, list): | ||
| audio_data = torch.cat(audio_data, dim=-1) |
There was a problem hiding this comment.
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 👍 / 👎.
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
Added type and shape checks for audio_data
Fix: #1083
Fix: JiusiServe#93
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)