revert
Browse files
app.py
CHANGED
|
@@ -251,18 +251,16 @@ with gr.Blocks() as iface:
|
|
| 251 |
augment_checkboxgroup.change(lambda methods: gr.update(visible="add_noise" in methods), inputs=[augment_checkboxgroup], outputs=[noise_slider])
|
| 252 |
augment_checkboxgroup.change(lambda methods: gr.update(visible="sharpen" in methods), inputs=[augment_checkboxgroup], outputs=[sharpen_slider])
|
| 253 |
|
| 254 |
-
project_accordion_state = gr.State(value=True) # State to manage accordion open/close
|
| 255 |
-
|
| 256 |
predict_button.click(
|
| 257 |
fn=predict_image_with_html,
|
| 258 |
-
inputs=inputs
|
| 259 |
-
outputs=outputs
|
| 260 |
)
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
inputs=[
|
| 265 |
-
outputs=[
|
| 266 |
)
|
| 267 |
|
| 268 |
with gr.Tab("Another Interface"):
|
|
|
|
| 251 |
augment_checkboxgroup.change(lambda methods: gr.update(visible="add_noise" in methods), inputs=[augment_checkboxgroup], outputs=[noise_slider])
|
| 252 |
augment_checkboxgroup.change(lambda methods: gr.update(visible="sharpen" in methods), inputs=[augment_checkboxgroup], outputs=[sharpen_slider])
|
| 253 |
|
|
|
|
|
|
|
| 254 |
predict_button.click(
|
| 255 |
fn=predict_image_with_html,
|
| 256 |
+
inputs=inputs,
|
| 257 |
+
outputs=outputs
|
| 258 |
)
|
| 259 |
+
predict_button.click(
|
| 260 |
+
fn=None,
|
| 261 |
+
js="() => {document.getElementById('project_accordion').open = false;}", # Close the project accordion
|
| 262 |
+
inputs=[],
|
| 263 |
+
outputs=[]
|
| 264 |
)
|
| 265 |
|
| 266 |
with gr.Tab("Another Interface"):
|