multimodalart HF staff commited on
Commit
6f329ae
1 Parent(s): 9bbaa16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -118,6 +118,9 @@ def merge_incompatible_lora(full_path_lora, lora_scale):
118
  lora_model.merge_to(
119
  pipe.text_encoder, pipe.unet, weights_sd, torch.float16, "cuda"
120
  )
 
 
 
121
 
122
  def run_lora(prompt, negative, lora_scale, selected_state):
123
  global last_lora, last_merged, pipe
 
118
  lora_model.merge_to(
119
  pipe.text_encoder, pipe.unet, weights_sd, torch.float16, "cuda"
120
  )
121
+ del weights_sd
122
+ del lora_model
123
+ gc.collect()
124
 
125
  def run_lora(prompt, negative, lora_scale, selected_state):
126
  global last_lora, last_merged, pipe