[Doc] Fix Qwen3-Omni modality documentation examples (#5173)
Signed-off-by: psv666 <2693925048@qq.com> Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
1 parent
4fbbdfd250
commit
e9991a5907
2 files changed
+16
-10
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user