Skip to content

Commit 6beace4

Browse files
committed
update
1 parent 7872c06 commit 6beace4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/diffusers/training_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ def free_memory():
319319

320320

321321
@contextmanager
322-
def offload_models(*modules: torch.nn.Module | DiffusionPipeline, device: str | torch.device, offload: bool = True):
322+
def offload_models(
323+
*modules: Union[torch.nn.Module, DiffusionPipeline], device: Union[str, torch.device], offload: bool = True
324+
):
323325
"""
324326
Context manager that, if offload=True, moves each module to `device` on enter, then moves it back to its original
325327
device on exit.

0 commit comments

Comments
 (0)