From d8a32a6a87edba12e574aa88fc6b73ec0202b5a2 Mon Sep 17 00:00:00 2001 From: UsamaKenway <56207634+UsamaKenway@users.noreply.github.com> Date: Sun, 22 Feb 2026 14:17:09 +0100 Subject: [PATCH] [Misc] Add Qwen2.5-Omni-3B model support to Gradio demo (#1382) Signed-off-by: UsamaKenway --- .../qwen2_5_omni/gradio_demo.py | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/examples/online_serving/qwen2_5_omni/gradio_demo.py b/examples/online_serving/qwen2_5_omni/gradio_demo.py index a6d3a67e8..4fdef5248 100644 --- a/examples/online_serving/qwen2_5_omni/gradio_demo.py +++ b/examples/online_serving/qwen2_5_omni/gradio_demo.py @@ -15,38 +15,43 @@ from PIL import Image SEED = 42 +DEFAULT_SAMPLING_PARAMS = { + "thinker": { + "temperature": 0.0, + "top_p": 1.0, + "top_k": -1, + "max_tokens": 2048, + "seed": SEED, + "detokenize": True, + "repetition_penalty": 1.1, + }, + "talker": { + "temperature": 0.9, + "top_p": 0.8, + "top_k": 40, + "max_tokens": 2048, + "seed": SEED, + "detokenize": True, + "repetition_penalty": 1.05, + "stop_token_ids": [8294], + }, + "code2wav": { + "temperature": 0.0, + "top_p": 1.0, + "top_k": -1, + "max_tokens": 2048, + "seed": SEED, + "detokenize": True, + "repetition_penalty": 1.1, + }, +} + SUPPORTED_MODELS: dict[str, dict[str, Any]] = { + "Qwen/Qwen2.5-Omni-3B": { + "sampling_params": DEFAULT_SAMPLING_PARAMS, + }, "Qwen/Qwen2.5-Omni-7B": { - "sampling_params": { - "thinker": { - "temperature": 0.0, - "top_p": 1.0, - "top_k": -1, - "max_tokens": 2048, - "seed": SEED, - "detokenize": True, - "repetition_penalty": 1.1, - }, - "talker": { - "temperature": 0.9, - "top_p": 0.8, - "top_k": 40, - "max_tokens": 2048, - "seed": SEED, - "detokenize": True, - "repetition_penalty": 1.05, - "stop_token_ids": [8294], - }, - "code2wav": { - "temperature": 0.0, - "top_p": 1.0, - "top_k": -1, - "max_tokens": 2048, - "seed": SEED, - "detokenize": True, - "repetition_penalty": 1.1, - }, - }, + "sampling_params": DEFAULT_SAMPLING_PARAMS, }, } # Ensure deterministic behavior across runs.