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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user