From e9991a59077dc5e32795fc4cbf2f097d0d0fe5a5 Mon Sep 17 00:00:00 2001 From: psv666 <150513104+psv666@users.noreply.github.com> Date: Sat, 18 Jul 2026 19:51:38 +0800 Subject: [PATCH] [Doc] Fix Qwen3-Omni modality documentation examples (#5173) Signed-off-by: psv666 <2693925048@qq.com> Co-authored-by: amy-why-3459 --- .../examples/online_serving/qwen3_omni.md | 13 ++++++++----- examples/online_serving/qwen3_omni/README.md | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/user_guide/examples/online_serving/qwen3_omni.md b/docs/user_guide/examples/online_serving/qwen3_omni.md index ec509d597..e372692a8 100644 --- a/docs/user_guide/examples/online_serving/qwen3_omni.md +++ b/docs/user_guide/examples/online_serving/qwen3_omni.md @@ -140,7 +140,7 @@ You can control output modalities to specify which types of output the model sho | Modalities | Output | |------------|--------| | `["text"]` | Text only | -| `["audio"]` | Text + Audio | +| `["audio"]` | Audio only | | `["text", "audio"]` | Text + Audio | | Not specified | Text + Audio (default) | @@ -161,13 +161,16 @@ curl http://localhost:8091/v1/chat/completions \ #### Text + Audio ```bash -curl http://localhost:8091/v1/chat/completions \ +response=$(curl -s http://localhost:8091/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Qwen/Qwen3-Omni-30B-A3B-Instruct", "messages": [{"role": "user", "content": "Describe vLLM in brief."}], - "modalities": ["audio"] - }' + "modalities": ["text", "audio"] + }') + +echo "$response" | jq -r '.choices[0].message.content' +echo "$response" | jq -r '.choices[1].message.audio.data' | base64 -d > output.wav ``` ### Using Python client @@ -205,7 +208,7 @@ client = OpenAI(base_url="http://localhost:8091/v1", api_key="EMPTY") response = client.chat.completions.create( model="Qwen/Qwen3-Omni-30B-A3B-Instruct", messages=[{"role": "user", "content": "Describe vLLM in brief."}], - modalities=["audio"] + modalities=["text", "audio"] ) # Response contains two choices: one with text, one with audio print(response.choices[0].message.content) # Text response diff --git a/examples/online_serving/qwen3_omni/README.md b/examples/online_serving/qwen3_omni/README.md index 3c3ad2b16..74a18af32 100644 --- a/examples/online_serving/qwen3_omni/README.md +++ b/examples/online_serving/qwen3_omni/README.md @@ -353,13 +353,16 @@ curl http://localhost:8091/v1/chat/completions \ #### Text + Audio ```bash -curl -s http://localhost:8091/v1/chat/completions \ +response=$(curl -s http://localhost:8091/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Qwen/Qwen3-Omni-30B-A3B-Instruct", "messages": [{"role": "user", "content": "Describe vLLM in brief."}], - "modalities": ["audio"] - }' | jq -r '.choices[0].message.audio.data' | base64 -d > output.wav + "modalities": ["text", "audio"] + }') + +echo "$response" | jq -r '.choices[0].message.content' +echo "$response" | jq -r '.choices[1].message.audio.data' | base64 -d > output.wav ``` ### Using Python client @@ -456,8 +459,8 @@ response = client.chat.completions.create( modalities=["audio"], extra_body={"speaker": "chelsie"} ) -# Audio uses the specified speaker -print(response.choices[1].message.audio) +# Audio-only responses contain a single audio choice +print(response.choices[0].message.audio) ``` Supported speaker names depend on the model (e.g. `Ethan`, `Chelsie`, `Aiden`). Omit `speaker` to use the default.