Skip to content

Commit

Permalink
memory improvement as done here: huggingface#9829
Browse files Browse the repository at this point in the history
  • Loading branch information
linoytsaban committed Nov 1, 2024
1 parent a98a839 commit dda1cb8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,9 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
epoch=epoch,
torch_dtype=weight_dtype,
)
images = None
del pipeline

if freeze_text_encoder:
del text_encoder_one, text_encoder_two
free_memory()
Expand Down Expand Up @@ -2448,6 +2451,8 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
commit_message="End of training",
ignore_patterns=["step_*", "epoch_*"],
)
images = None
del pipeline

accelerator.end_training()

Expand Down

0 comments on commit dda1cb8

Please sign in to comment.