From a9b727a6122a0817ecb4eba61baeeb52e9a7d7f5 Mon Sep 17 00:00:00 2001 From: Isotr0py Date: Tue, 27 Oct 2026 23:20:03 +0800 Subject: [PATCH] [UX] Remove `--hf-overrides` necessity for Qwen3-ASR-ForceAligner (#63274) Signed-off-by: Isotr0py Co-authored-by: vllm-agent --- docs/models/pooling_models/token_classify.md | 6 +----- .../token_classify/forced_alignment_offline.py | 1 - .../pooling/test_qwen3_asr_forced_aligner.py | 5 ----- .../models/qwen3_asr_forced_aligner.py | 3 --- .../model_arch_config_convertor.py | 14 ++++++++++++++ 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/models/pooling_models/token_classify.md b/docs/models/pooling_models/token_classify.md index ae964203264..bf1d5ce11c6 100644 --- a/docs/models/pooling_models/token_classify.md +++ b/docs/models/pooling_models/token_classify.md @@ -64,11 +64,7 @@ If your model is not in the above list, we will try to automatically convert the | Architecture | Models | Inputs | Example HF Models | [LoRA](../../features/lora.md) | [PP](../../serving/parallelism_scaling.md) | | --------------------------------------------- | ------------------- | ----------------- | ------------------------------------------ | ------------------------------ | ------------------------------------------ | -| `Qwen3ASRForcedAlignerForTokenClassification` | Qwen3-ForcedAligner | T + A+ | `Qwen/Qwen3-ForcedAligner-0.6B` (see note) | | ✅︎ | - -!!! note - Forced alignment usage requires `--hf-overrides '{"architectures": ["Qwen3ASRForcedAlignerForTokenClassification"]}'`. - Please refer to [examples/pooling/token_classify/forced_alignment_offline.py](../../../examples/pooling/token_classify/forced_alignment_offline.py). +| `Qwen3ASRForcedAlignerForTokenClassification` | Qwen3-ForcedAligner | T + A+ | `Qwen/Qwen3-ForcedAligner-0.6B` | | ✅︎ | ### Reward Models diff --git a/examples/pooling/token_classify/forced_alignment_offline.py b/examples/pooling/token_classify/forced_alignment_offline.py index 13facab4806..5537ad8e291 100644 --- a/examples/pooling/token_classify/forced_alignment_offline.py +++ b/examples/pooling/token_classify/forced_alignment_offline.py @@ -30,7 +30,6 @@ def parse_args(): model="Qwen/Qwen3-ForcedAligner-0.6B", runner="pooling", enforce_eager=True, - hf_overrides={"architectures": ["Qwen3ASRForcedAlignerForTokenClassification"]}, ) return parser.parse_args() diff --git a/tests/models/multimodal/pooling/test_qwen3_asr_forced_aligner.py b/tests/models/multimodal/pooling/test_qwen3_asr_forced_aligner.py index b29d0d58541..abba8327c55 100644 --- a/tests/models/multimodal/pooling/test_qwen3_asr_forced_aligner.py +++ b/tests/models/multimodal/pooling/test_qwen3_asr_forced_aligner.py @@ -35,11 +35,6 @@ def test_qwen3_forced_aligner( dtype=dtype, enforce_eager=True, max_model_len=512, - hf_overrides={ - "architectures": [ - "Qwen3ASRForcedAlignerForTokenClassification", - ], - }, ) as vllm_model: outputs = vllm_model.llm.encode( [{"prompt": prompt, "multi_modal_data": {"audio": audio}}], diff --git a/vllm/model_executor/models/qwen3_asr_forced_aligner.py b/vllm/model_executor/models/qwen3_asr_forced_aligner.py index a7aad6628d9..d0647a0ffa5 100644 --- a/vllm/model_executor/models/qwen3_asr_forced_aligner.py +++ b/vllm/model_executor/models/qwen3_asr_forced_aligner.py @@ -41,9 +41,6 @@ class Qwen3ASRForcedAlignerForTokenClassification( llm = LLM( model="Qwen/Qwen3-ForcedAligner-0.6B", runner="pooling", - hf_overrides={ - "architectures": ["Qwen3ASRForcedAlignerForTokenClassification"] - }, ) outputs = llm.encode( [{"prompt": prompt, "multi_modal_data": {"audio": audio}}], diff --git a/vllm/transformers_utils/model_arch_config_convertor.py b/vllm/transformers_utils/model_arch_config_convertor.py index b206035322f..55c88c52cab 100644 --- a/vllm/transformers_utils/model_arch_config_convertor.py +++ b/vllm/transformers_utils/model_arch_config_convertor.py @@ -651,6 +651,19 @@ class Qwen3_5ModelArchConfigConvertor(ModelArchConfigConvertorBase): super().__init__(hf_config, hf_text_config, revision) +class Qwen3ASRModelArchConfigConvertor(ModelArchConfigConvertorBase): + def __init__( + self, + hf_config: PreTrainedConfig, + hf_text_config: PreTrainedConfig, + revision: str | None = None, + ): + thinker_config = getattr(hf_config, "thinker_config", None) + if getattr(thinker_config, "model_type", None) == "qwen3_forced_aligner": + hf_config.architectures = ["Qwen3ASRForcedAlignerForTokenClassification"] + super().__init__(hf_config, hf_text_config, revision) + + class Qwen3OmniMoeModelArchConfigConvertor(ModelArchConfigConvertorBase): def __init__( self, @@ -865,6 +878,7 @@ MODEL_ARCH_CONFIG_CONVERTORS = { "pangu_ultra_moe_mtp": PanguUltraMoeMTPModelArchConfigConvertor, "qwen3_5": Qwen3_5ModelArchConfigConvertor, "qwen3_5_mtp": Qwen3_5MTPModelArchConfigConvertor, + "qwen3_asr": Qwen3ASRModelArchConfigConvertor, "qwen3_omni_moe": Qwen3OmniMoeModelArchConfigConvertor, "qwen3_next_mtp": Qwen3NextMTPModelArchConfigConvertor, "qwen4_exp_mtp": Qwen4ExpMTPModelArchConfigConvertor,