From 0309b3bd197ee1b1ce76252b93ed688afdbed8e0 Mon Sep 17 00:00:00 2001 From: Yuanheng Zhao <54058983+yuanheng-zhao@users.noreply.github.com> Date: Thu, 30 Apr 2026 18:25:25 +0800 Subject: [PATCH] [Bugfix] Prevent silent failure of get_config when trust_remote_code passed as None (#3241) Signed-off-by: Yuanheng Zhao --- vllm_omni/config/stage_config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vllm_omni/config/stage_config.py b/vllm_omni/config/stage_config.py index 950685d62..44cc83bae 100644 --- a/vllm_omni/config/stage_config.py +++ b/vllm_omni/config/stage_config.py @@ -1009,6 +1009,8 @@ class StageConfigFactory: cli_overrides = {} trust_remote_code = cli_overrides.get("trust_remote_code", True) + if trust_remote_code is None: + trust_remote_code = False # --- New path: check pipeline registry by model_type first --- model_type, hf_config = cls._auto_detect_model_type(model, trust_remote_code=trust_remote_code) @@ -1352,8 +1354,8 @@ class StageConfigFactory: hf_config = get_config(model, trust_remote_code=trust_remote_code) return hf_config.model_type, hf_config - except Exception: - pass + except Exception as e: + logger.debug(f"`get_config` failed for {e}; Falling back to raw config.json path") # Fallback: read config.json directly for custom model types that # are not registered with transformers (e.g. qwen3_tts). @@ -1390,8 +1392,8 @@ class StageConfigFactory: class_name, ) return pipeline_cfg.model_type, None - except Exception: - pass + except Exception as e: + logger.debug(f"Failed to detect model type for diffusers-style models: {e}") # Final fallback: some models (e.g. CosyVoice3) ship an empty # config.json and rely on naming conventions. Match the model path