Unverified Commit d25eb5d3 authored by townwish4git's avatar townwish4git Committed by GitHub
Browse files

fix(sd3): fix deletion of text_encoders etc (#8951)


Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
parent 7ef8a465
...@@ -1454,7 +1454,7 @@ def main(args): ...@@ -1454,7 +1454,7 @@ def main(args):
) )
# Clear the memory here # Clear the memory here
if not args.train_text_encoder and train_dataset.custom_instance_prompts: if not args.train_text_encoder and not train_dataset.custom_instance_prompts:
del tokenizers, text_encoders del tokenizers, text_encoders
# Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection # Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection
del text_encoder_one, text_encoder_two, text_encoder_three del text_encoder_one, text_encoder_two, text_encoder_three
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment