From 7cb7b3e8add6401c50ca6a684f3f34aad1ad62a9 Mon Sep 17 00:00:00 2001 From: noobHappylife <64898326+noobHappylife@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:42:09 +0800 Subject: [PATCH] Fix Qwen3-TTS gradio demo (#2372) Signed-off-by: noobhappylife --- examples/online_serving/qwen3_tts/gradio_demo.py | 16 ++++++++++------ examples/online_serving/qwen3_tts/tts_common.py | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/examples/online_serving/qwen3_tts/gradio_demo.py b/examples/online_serving/qwen3_tts/gradio_demo.py index b263cb8a2..8b39b9eab 100644 --- a/examples/online_serving/qwen3_tts/gradio_demo.py +++ b/examples/online_serving/qwen3_tts/gradio_demo.py @@ -125,7 +125,7 @@ PLAYER_HTML = """ def _build_player_js(sample_rate: int) -> str: """Build the JavaScript that powers the AudioWorklet player.""" return f""" -() => {{ + """ @@ -435,10 +435,7 @@ def create_app(api_base: str): ) with gr.Blocks( - css=css, title="Qwen3-TTS Demo", - js=_build_player_js(PCM_SAMPLE_RATE), - theme=theme, ) as demo: gr.HTML(f"""
@@ -773,7 +770,14 @@ def create_app(api_base: str): demo.queue() - return gr.mount_gradio_app(fastapi_app, demo, path="/") + return gr.mount_gradio_app( + fastapi_app, + demo, + path="/", + css=css, + theme=theme, + head=_build_player_js(PCM_SAMPLE_RATE), + ) def parse_args(): diff --git a/examples/online_serving/qwen3_tts/tts_common.py b/examples/online_serving/qwen3_tts/tts_common.py index 20b78517e..44ba7c3ab 100644 --- a/examples/online_serving/qwen3_tts/tts_common.py +++ b/examples/online_serving/qwen3_tts/tts_common.py @@ -103,7 +103,7 @@ def build_payload( if task_type == "CustomVoice": if voice: - payload["speaker"] = voice + payload["voice"] = voice if instructions and instructions.strip(): payload["instructions"] = instructions.strip()