Unverified Commit 2c1a4f24 authored by Jzz1943's avatar Jzz1943 Committed by GitHub
Browse files

[Bugfix]: avoid overriding audio/text kwargs (Qwen3-Omni) (#31790)


Signed-off-by: default avatarZhongze Jiang <jiangzhongze.jzz@ant-intl.com>
parent 64448248
...@@ -750,18 +750,20 @@ class Qwen3OmniMoeThinkerMultiModalProcessor( ...@@ -750,18 +750,20 @@ class Qwen3OmniMoeThinkerMultiModalProcessor(
# https://github.com/huggingface/transformers/pull/41473 # https://github.com/huggingface/transformers/pull/41473
mm_kwargs = dict(mm_kwargs) mm_kwargs = dict(mm_kwargs)
tok_kwargs = dict(tok_kwargs) tok_kwargs = dict(tok_kwargs)
mm_kwargs["audio_kwargs"] = dict(mm_kwargs.get("audio_kwargs") or {})
mm_kwargs["text_kwargs"] = dict(mm_kwargs.get("text_kwargs") or {})
if Version(TRANSFORMERS_VERSION) < Version("4.58.0"): if Version(TRANSFORMERS_VERSION) < Version("4.58.0"):
# Extract audio_sample_rate before restructuring # Extract audio_sample_rate before restructuring
audio_sample_rate = mm_kwargs.pop("audio_sample_rate", None) audio_sample_rate = mm_kwargs.pop("audio_sample_rate", None)
# move truncation to audio_kwargs level to avoid conflict # move truncation to audio_kwargs level to avoid conflict
# with tok_kwargs # with tok_kwargs
mm_kwargs["audio_kwargs"] = { mm_kwargs["audio_kwargs"].setdefault(
"truncation": mm_kwargs.pop("truncation", False) "truncation", mm_kwargs.pop("truncation", False)
} )
mm_kwargs["text_kwargs"] = { mm_kwargs["text_kwargs"].setdefault(
"truncation": tok_kwargs.pop("truncation", False) "truncation", tok_kwargs.pop("truncation", False)
} )
# Validate and conditionally pass audio_sample_rate # Validate and conditionally pass audio_sample_rate
# WhisperFeatureExtractor has a fixed sampling rate, and vLLM's # WhisperFeatureExtractor has a fixed sampling rate, and vLLM's
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment