[Bugfix] Print text alongside audio in multimodal chat example (#8130)
Signed-off-by: Gao Han <hgaoaf@connect.ust.hk>
This commit is contained in:
1 parent
f58ef57ac4
commit
b7c0e541d2
1 file changed
+5
-1
@@ -1,3 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
import base64
|
||||
import concurrent.futures
|
||||
import os
|
||||
@@ -457,7 +460,8 @@ def run_multimodal_generation(args, client: OpenAI) -> None:
|
||||
f.write(audio_data)
|
||||
print(f"Audio saved to {audio_file_path}")
|
||||
count += 1
|
||||
elif choice.message.content:
|
||||
# A choice can contain both audio and text.
|
||||
if choice.message.content:
|
||||
print("Chat completion output from text:", choice.message.content)
|
||||
else:
|
||||
printed_content = False
|
||||
|
||||
Reference in new issue
Block a user