fix(modelloader): convert ModelCardData to dict before saving model_info.json

This commit is contained in:
CalamitousFelicitousness
2026-05-21 03:11:05 +01:00
parent 394d4e5b84
commit 98ea64943f
+2 -1
View File
@@ -99,7 +99,8 @@ def download_diffusers_model(hub_id: str, cache_dir: str | None = None, download
shared.state.end(jobid)
return None
try:
model_info_dict = hf.model_info(hub_id).cardData if pipeline_dir is not None else None
card = hf.model_info(hub_id).cardData
model_info_dict = card.to_dict() if hasattr(card, 'to_dict') else card
except Exception:
model_info_dict = None
if model_info_dict is not None and "prior" in model_info_dict: # some checkpoints need to be downloaded as "hidden" as they just serve as pre- or post-pipelines of other pipelines