diff options
Diffstat (limited to 'training/strategy/lora.py')
-rw-r--r-- | training/strategy/lora.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/training/strategy/lora.py b/training/strategy/lora.py index 73ec8f2..1517ee8 100644 --- a/training/strategy/lora.py +++ b/training/strategy/lora.py | |||
@@ -140,8 +140,7 @@ def lora_strategy_callbacks( | |||
140 | with open(checkpoint_output_dir / "lora_config.json", "w") as f: | 140 | with open(checkpoint_output_dir / "lora_config.json", "w") as f: |
141 | json.dump(lora_config, f) | 141 | json.dump(lora_config, f) |
142 | 142 | ||
143 | del unet_ | 143 | del unet_, text_encoder_ |
144 | del text_encoder_ | ||
145 | 144 | ||
146 | if torch.cuda.is_available(): | 145 | if torch.cuda.is_available(): |
147 | torch.cuda.empty_cache() | 146 | torch.cuda.empty_cache() |
@@ -153,8 +152,7 @@ def lora_strategy_callbacks( | |||
153 | 152 | ||
154 | save_samples_(step=step, unet=unet_, text_encoder=text_encoder_) | 153 | save_samples_(step=step, unet=unet_, text_encoder=text_encoder_) |
155 | 154 | ||
156 | del unet_ | 155 | del unet_, text_encoder_ |
157 | del text_encoder_ | ||
158 | 156 | ||
159 | if torch.cuda.is_available(): | 157 | if torch.cuda.is_available(): |
160 | torch.cuda.empty_cache() | 158 | torch.cuda.empty_cache() |