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 Patrick von Platen
parent af85591593
commit 47f2d2c7be

View File

@@ -1255,7 +1255,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