Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -579,9 +579,10 @@ with gr.Blocks(css="""
|
|
579 |
|
580 |
# Use the theme detection from JavaScript
|
581 |
theme_output = gr.Textbox(label="Theme", visible=False)
|
582 |
-
|
583 |
-
|
584 |
-
|
|
|
585 |
|
586 |
# Update the confusion matrices whenever sliders change
|
587 |
data_percentage_slider.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown, theme_output], outputs=[raw_img_bp, embeddings_img_bp])
|
|
|
579 |
|
580 |
# Use the theme detection from JavaScript
|
581 |
theme_output = gr.Textbox(label="Theme", visible=False)
|
582 |
+
# Update the theme on button click (or any event)
|
583 |
+
theme_button = gr.Button("Detect Theme")
|
584 |
+
# Trigger JS to detect theme and set value to theme_output
|
585 |
+
theme_button.click(fn=None, inputs=[], outputs=[theme_output], _js=js_code)
|
586 |
|
587 |
# Update the confusion matrices whenever sliders change
|
588 |
data_percentage_slider.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown, theme_output], outputs=[raw_img_bp, embeddings_img_bp])
|