only remove module if necessary

This commit is contained in:
Patrick von Platen 2022-06-22 13:42:09 +00:00
parent fc596c8625
commit 40e28e8bf4
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class DiffusionPipeline(ConfigMixin):
model_index_dict = dict(self.config)
model_index_dict.pop("_class_name")
model_index_dict.pop("_diffusers_version")
model_index_dict.pop("_module")
model_index_dict.pop("_module", None)
for pipeline_component_name in model_index_dict.keys():
sub_model = getattr(self, pipeline_component_name)