Skip to content

Commit d25eb5d

Browse files
townwish4gitsayakpaulyiyixuxu
authored
fix(sd3): fix deletion of text_encoders etc (#8951)
Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: YiYi Xu <[email protected]>
1 parent 7ef8a46 commit d25eb5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/dreambooth/train_dreambooth_lora_sd3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ def compute_text_embeddings(prompt, text_encoders, tokenizers):
14541454
)
14551455

14561456
# Clear the memory here
1457-
if not args.train_text_encoder and train_dataset.custom_instance_prompts:
1457+
if not args.train_text_encoder and not train_dataset.custom_instance_prompts:
14581458
del tokenizers, text_encoders
14591459
# Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection
14601460
del text_encoder_one, text_encoder_two, text_encoder_three

0 commit comments

Comments
 (0)