Skip to content

Commit 0a2338e

Browse files
authored
fix a bug about loop call
1 parent 3c8b67b commit 0a2338e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/diffusers/models/modeling_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,4 +1880,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
18801880
# resolve remapping
18811881
remapped_class = _fetch_remapped_cls_from_config(config, cls)
18821882

1883-
return remapped_class.from_pretrained(pretrained_model_name_or_path, **kwargs_copy)
1883+
if remapped_class is cls:
1884+
return super(LegacyModelMixin,remapped_class).from_pretrained(pretrained_model_name_or_path, **kwargs_copy)
1885+
else:
1886+
return remapped_class.from_pretrained(pretrained_model_name_or_path, **kwargs_copy)

0 commit comments

Comments
 (0)