Spaces:
Runtime error
Runtime error
try to clean gpu memory each time the set_pipe is called with existing editor on device
Browse files
app.py
CHANGED
@@ -63,6 +63,10 @@ with gr.Blocks(css="style.css") as demo:
|
|
63 |
|
64 |
if image_editor is not None:
|
65 |
image_editor = image_editor.to('cpu')
|
|
|
|
|
|
|
|
|
66 |
|
67 |
if input_image is None or not description_prompt:
|
68 |
return None, "Please set all inputs."
|
|
|
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."
|