Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -212,8 +212,7 @@ with gr.Blocks() as demo:
|
|
| 212 |
|
| 213 |
|
| 214 |
#with gr.Tab(label="2 Optimization"):
|
| 215 |
-
|
| 216 |
-
# with gr.Column():
|
| 217 |
result_info = gr.Text(label="Response")
|
| 218 |
|
| 219 |
opt_flag = gr.State(0)
|
|
@@ -260,16 +259,14 @@ with gr.Blocks() as demo:
|
|
| 260 |
)
|
| 261 |
run_optimization()
|
| 262 |
gr.Info("Optimization Finished! Move to the next step.")
|
| 263 |
-
return "Optimization finished! Move to the next step.",gr.Button("Step 3. Run Editing
|
| 264 |
except Exception as e:
|
| 265 |
print(e)
|
| 266 |
gr.Error("e")
|
| 267 |
-
return "Error: use a smaller batch size or try latter.",gr.Button("Step 3. Run Editing
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
-
#with gr.Tab(label="3 Editing"):
|
| 272 |
-
with gr.Tab(label="Text-based editing"):
|
| 273 |
|
| 274 |
with gr.Row():
|
| 275 |
with gr.Column():
|
|
@@ -286,7 +283,7 @@ with gr.Blocks() as demo:
|
|
| 286 |
edge_thickness = gr.Number(value="10", label="Editing: Edge thickness", interactive= True )
|
| 287 |
strength = gr.Textbox(value="0.5", label="Editing: Mask strength", interactive= True )
|
| 288 |
|
| 289 |
-
add_button2 = gr.Button("Step 3. Run Editing
|
| 290 |
def run_edit_text_wrapper(
|
| 291 |
mask_np_list,
|
| 292 |
mask_label_list,
|
|
|
|
| 212 |
|
| 213 |
|
| 214 |
#with gr.Tab(label="2 Optimization"):
|
| 215 |
+
|
|
|
|
| 216 |
result_info = gr.Text(label="Response")
|
| 217 |
|
| 218 |
opt_flag = gr.State(0)
|
|
|
|
| 259 |
)
|
| 260 |
run_optimization()
|
| 261 |
gr.Info("Optimization Finished! Move to the next step.")
|
| 262 |
+
return "Optimization finished! Move to the next step.",gr.Button("Step 3. Run Editing",interactive = True)
|
| 263 |
except Exception as e:
|
| 264 |
print(e)
|
| 265 |
gr.Error("e")
|
| 266 |
+
return "Error: use a smaller batch size or try latter.",gr.Button("Step 3. Run Editing",interactive = False)
|
| 267 |
|
| 268 |
|
| 269 |
|
|
|
|
|
|
|
| 270 |
|
| 271 |
with gr.Row():
|
| 272 |
with gr.Column():
|
|
|
|
| 283 |
edge_thickness = gr.Number(value="10", label="Editing: Edge thickness", interactive= True )
|
| 284 |
strength = gr.Textbox(value="0.5", label="Editing: Mask strength", interactive= True )
|
| 285 |
|
| 286 |
+
add_button2 = gr.Button("Step 3. Run Editing",interactive = False)
|
| 287 |
def run_edit_text_wrapper(
|
| 288 |
mask_np_list,
|
| 289 |
mask_label_list,
|