1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Fix model offload bug when key isn't present (#5030)

* fix model offload bug when key isn't present

* make style
This commit is contained in:
Dhruv Nair
2023-09-14 14:32:06 +05:30
committed by GitHub
parent 19edca82f1
commit e2033d2dff

View File

@@ -1252,7 +1252,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
self._all_hooks = []
hook = None
for model_str in self.model_cpu_offload_seq.split("->"):
model = all_model_components.pop(model_str)
model = all_model_components.pop(model_str, None)
if not isinstance(model, torch.nn.Module):
continue