Skip to content

Commit

Permalink
delete vae and text encoders after use in SDXL training script (huggi…
Browse files Browse the repository at this point in the history
…ngface#6693)

delete vae and text encoders after use

Co-authored-by: Sayak Paul <[email protected]>
  • Loading branch information
noskill and sayakpaul authored Mar 18, 2024
1 parent 4330a74 commit 98d46a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/text_to_image/train_text_to_image_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ def preprocess_train(examples):
)
precomputed_dataset = precomputed_dataset.with_transform(preprocess_train)

del compute_vae_encodings_fn, compute_embeddings_fn, text_encoder_one, text_encoder_two
del text_encoders, tokenizers, vae
gc.collect()
torch.cuda.empty_cache()
Expand Down

0 comments on commit 98d46a3

Please sign in to comment.