Skip to content

Commit 7a52475

Browse files
committed
[Bugfix] Fix 'NoneType' AttributeError in stable-diffusion model detect
Signed-off-by: Yan Ma <yan.ma@intel.com>
1 parent 10f841b commit 7a52475

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vllm_omni/diffusion/utils/hf_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ def _looks_like_bagel(model_name: str) -> bool:
1818
"""Best-effort detection for Bagel (non-diffusers) diffusion models."""
1919
try:
2020
cfg = get_hf_file_to_dict("config.json", model_name)
21+
model_type = cfg.get("model_type")
22+
if model_type == "bagel":
23+
return True
24+
architectures = cfg.get("architectures") or []
25+
return "BagelForConditionalGeneration" in architectures
2126
except Exception:
2227
return False
23-
model_type = cfg.get("model_type")
24-
if model_type == "bagel":
25-
return True
26-
architectures = cfg.get("architectures") or []
27-
return "BagelForConditionalGeneration" in architectures
2828

2929

3030
@lru_cache

0 commit comments

Comments
 (0)