Unverified Commit e2033d2d authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

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

* fix model offload bug when key isn't present

* make style
parent 19edca82
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment