michaelapplydesign commited on
Commit
d777d7d
·
1 Parent(s): 8229af0

try fix memory

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
  # os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
3
  # os.environ['CUDA_VISIBLE_DEVICES'] = '2'
 
4
  import gradio as gr
5
  import numpy as np
6
  from models import make_inpainting
@@ -93,6 +94,7 @@ def upscale(image, prompt):
93
 
94
  return upscaled_image
95
 
 
96
  with gr.Blocks() as app:
97
  with gr.Row():
98
 
@@ -123,6 +125,7 @@ with gr.Blocks() as app:
123
  with gr.Column():
124
  gr.Button("Upscale").click(upscale, inputs=[gr.Image(type="pil"),gr.Textbox(label="prompt",value="empty room")], outputs=gr.Image())
125
 
 
126
  app.launch(debug=True,share=True)
127
 
128
  # UP 1
 
1
  import os
2
  # os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
3
  # os.environ['CUDA_VISIBLE_DEVICES'] = '2'
4
+ os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "caching_allocator"
5
  import gradio as gr
6
  import numpy as np
7
  from models import make_inpainting
 
94
 
95
  return upscaled_image
96
 
97
+
98
  with gr.Blocks() as app:
99
  with gr.Row():
100
 
 
125
  with gr.Column():
126
  gr.Button("Upscale").click(upscale, inputs=[gr.Image(type="pil"),gr.Textbox(label="prompt",value="empty room")], outputs=gr.Image())
127
 
128
+
129
  app.launch(debug=True,share=True)
130
 
131
  # UP 1