From b569cb56b6a01fbe5b0441fbd58314fea3455469 Mon Sep 17 00:00:00 2001 From: "rongfu.leng" Date: Thu, 26 Mar 2026 03:05:28 +0800 Subject: [PATCH] [Bugfix] add inject model_arch to hf_overrides (#2178) Signed-off-by: rongfu.leng --- vllm_omni/engine/arg_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vllm_omni/engine/arg_utils.py b/vllm_omni/engine/arg_utils.py index f3b04272e..651170f9a 100644 --- a/vllm_omni/engine/arg_utils.py +++ b/vllm_omni/engine/arg_utils.py @@ -125,6 +125,14 @@ class OmniEngineArgs(EngineArgs): } stage_connector_config["extra"]["stage_id"] = self.stage_id + # If model_arch is specified, inject it into hf_overrides so vLLM can + # resolve the architecture even when config.json lacks 'architectures'. + if self.model_arch: + if self.hf_overrides is None: + self.hf_overrides = {} + if isinstance(self.hf_overrides, dict): + self.hf_overrides.setdefault("architectures", [self.model_arch]) + # Build the vLLM config first, then use it to create the Omni config. model_config = super().create_model_config()