From 9327cccde615374031c44adcf9833951b0a0254d Mon Sep 17 00:00:00 2001 From: Yan Ma Date: Tue, 10 Feb 2026 15:25:08 +0800 Subject: [PATCH] [Bugfix] Fix 'NoneType' AttributeError in stable-diffusion model detect (#1254) 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 cfc1807a1..7935df1e4 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