barakmeiri commited on
Commit
6ca57b3
·
verified ·
1 Parent(s): f84c6ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -61,12 +61,11 @@ with gr.Blocks(css="style.css") as demo:
61
  def set_pipe(image_editor, input_image, description_prompt, edit_guidance_scale, num_inference_steps=4,
62
  num_inversion_steps=4, inversion_max_step=0.6, rnri_iterations=2, rnri_alpha=0.1, rnri_lr=0.2):
63
 
 
 
 
64
  if image_editor is not None:
65
  image_editor = image_editor.to('cpu')
66
- if device == 'cuda':
67
- torch.cuda.empty_cache()
68
- # print("#### torch.cuda.memory_summary(device=None, abbreviated=False):")
69
- # print(torch.cuda.memory_summary(device=None, abbreviated=False))
70
 
71
  if input_image is None or not description_prompt:
72
  return None, "Please set all inputs."
 
61
  def set_pipe(image_editor, input_image, description_prompt, edit_guidance_scale, num_inference_steps=4,
62
  num_inversion_steps=4, inversion_max_step=0.6, rnri_iterations=2, rnri_alpha=0.1, rnri_lr=0.2):
63
 
64
+ if device == 'cuda':
65
+ torch.cuda.empty_cache()
66
+
67
  if image_editor is not None:
68
  image_editor = image_editor.to('cpu')
 
 
 
 
69
 
70
  if input_image is None or not description_prompt:
71
  return None, "Please set all inputs."