From 7a5247504afb360b42df0114ac6a2726d138ead5 Mon Sep 17 00:00:00 2001 From: Yan Ma Date: Fri, 6 Feb 2026 14:42:50 +0000 Subject: [PATCH] [Bugfix] Fix 'NoneType' AttributeError in stable-diffusion model detect Signed-off-by: Yan Ma --- vllm_omni/diffusion/utils/hf_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vllm_omni/diffusion/utils/hf_utils.py b/vllm_omni/diffusion/utils/hf_utils.py index cfc1807a18..7935df1e46 100644 --- a/vllm_omni/diffusion/utils/hf_utils.py +++ b/vllm_omni/diffusion/utils/hf_utils.py @@ -18,13 +18,13 @@ def _looks_like_bagel(model_name: str) -> bool: """Best-effort detection for Bagel (non-diffusers) diffusion models.""" try: cfg = get_hf_file_to_dict("config.json", model_name) + model_type = cfg.get("model_type") + if model_type == "bagel": + return True + architectures = cfg.get("architectures") or [] + return "BagelForConditionalGeneration" in architectures except Exception: return False - model_type = cfg.get("model_type") - if model_type == "bagel": - return True - architectures = cfg.get("architectures") or [] - return "BagelForConditionalGeneration" in architectures @lru_cache