Skip to content

Commit ae850af

Browse files
pcuencaPrathik Rao
authored andcommitted
Fix main: stable diffusion pipelines cannot be loaded (huggingface#655)
* Replace deprecation warning f-string with class name. When `__repr__` is invoked in the instance serialization of `config_dict` fails, because it contains `kwargs` of type `<class inspect._empty>`. * Revert "Replace deprecation warning f-string with class name." This reverts commit 1c4eb8c. * Do not attempt to register `"kwargs"` as an attribute. Otherwise serialization could fail. This may happen for other attributes, so we should create a better solution.
1 parent 8b80e61 commit ae850af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/diffusers/configuration_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ def register_to_config(self, **kwargs):
5858
kwargs["_class_name"] = self.__class__.__name__
5959
kwargs["_diffusers_version"] = __version__
6060

61+
# Special case for `kwargs` used in deprecation warning added to schedulers
62+
# TODO: remove this when we remove the deprecation warning, and the `kwargs` argument,
63+
# or solve in a more general way.
64+
kwargs.pop("kwargs", None)
6165
for key, value in kwargs.items():
6266
try:
6367
setattr(self, key, value)

0 commit comments

Comments
 (0)