1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Update train_dreambooth_lora_sd3.py (#8600)

* Update train_dreambooth_lora_sd3.py

* Update train_dreambooth_lora_sd3.py

* Update train_dreambooth_sd3.py

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
This commit is contained in:
satani99
2024-06-20 17:42:24 +05:30
committed by GitHub
parent 668e34c6e0
commit 963ee05d16
2 changed files with 0 additions and 2 deletions

View File

@@ -1344,7 +1344,6 @@ def main(args):
if not train_dataset.custom_instance_prompts:
del tokenizers, text_encoders
# Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection
del tokenizer_one, tokenizer_two, tokenizer_three
del text_encoder_one, text_encoder_two, text_encoder_three
gc.collect()
if torch.cuda.is_available():

View File

@@ -1372,7 +1372,6 @@ def main(args):
if not args.train_text_encoder and not train_dataset.custom_instance_prompts:
del tokenizers, text_encoders
# Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection
del tokenizer_one, tokenizer_two, tokenizer_three
del text_encoder_one, text_encoder_two, text_encoder_three
gc.collect()
if torch.cuda.is_available():