Skip to content

Commit 4299b96

Browse files
committed
make style
1 parent 0af7498 commit 4299b96

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/diffusers/hooks/group_offloading.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,14 @@ def pre_forward(self, module: torch.nn.Module, *args, **kwargs):
302302
if self.group.onload_leader == module:
303303
if self.group.onload_self:
304304
self.group.onload_()
305-
305+
306306
should_onload_next_group = self.next_group is not None and not self.next_group.onload_self
307307
if should_onload_next_group:
308308
self.next_group.onload_()
309-
310-
should_synchronize = not self.group.onload_self and self.group.stream is not None and not should_onload_next_group
309+
310+
should_synchronize = (
311+
not self.group.onload_self and self.group.stream is not None and not should_onload_next_group
312+
)
311313
if should_synchronize:
312314
# If this group didn't onload itself, it means it was asynchronously onloaded by the
313315
# previous group. We need to synchronize the side stream to ensure parameters

0 commit comments

Comments
 (0)