Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -242,19 +242,12 @@ with gr.Blocks() as demo:
|
|
| 242 |
gradient_accumulation_steps=int(gradient_accumulation_steps)
|
| 243 |
)
|
| 244 |
run_optimization()
|
| 245 |
-
|
| 246 |
return "Optimization finished! Move to the next step.",gr.Button("Run Editing (Check log for progress.)",interactive = True)
|
| 247 |
except:
|
|
|
|
| 248 |
return "CUDA out of memory, use a smaller batch size or try another picture.",gr.Button("Run Editing (Check log for progress.)",interactive = False)
|
| 249 |
|
| 250 |
-
|
| 251 |
-
def immediate_update():
|
| 252 |
-
return gr.Button("Run Optimization (Check log for progress.).", interactive=True)
|
| 253 |
-
|
| 254 |
-
#add_button.click(fn=immediate_update, inputs=[], outputs=[add_button])
|
| 255 |
-
#add_button.update()
|
| 256 |
-
def change_text():
|
| 257 |
-
return gr.Textbox("Optimization Finished! Move to the next step.", interactive = False)
|
| 258 |
|
| 259 |
|
| 260 |
with gr.Tab(label="3 Editing"):
|
|
@@ -307,7 +300,7 @@ with gr.Blocks() as demo:
|
|
| 307 |
tgt_index = int(tgt_index)
|
| 308 |
)
|
| 309 |
run_edit_text()
|
| 310 |
-
gr.Info('Image
|
| 311 |
return load_pil_img()
|
| 312 |
|
| 313 |
|
|
|
|
| 242 |
gradient_accumulation_steps=int(gradient_accumulation_steps)
|
| 243 |
)
|
| 244 |
run_optimization()
|
| 245 |
+
gr.Info("Optimization Finished! Move to the next step.")
|
| 246 |
return "Optimization finished! Move to the next step.",gr.Button("Run Editing (Check log for progress.)",interactive = True)
|
| 247 |
except:
|
| 248 |
+
gr.Warning("CUDA out of memory, use a smaller batch size or try another picture.")
|
| 249 |
return "CUDA out of memory, use a smaller batch size or try another picture.",gr.Button("Run Editing (Check log for progress.)",interactive = False)
|
| 250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
|
| 252 |
|
| 253 |
with gr.Tab(label="3 Editing"):
|
|
|
|
| 300 |
tgt_index = int(tgt_index)
|
| 301 |
)
|
| 302 |
run_edit_text()
|
| 303 |
+
gr.Info('Image editing completed.')
|
| 304 |
return load_pil_img()
|
| 305 |
|
| 306 |
|