Update app.py
Browse files
app.py
CHANGED
|
@@ -196,18 +196,18 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue")) as demo:
|
|
| 196 |
label="Example texts with similar tone"
|
| 197 |
)
|
| 198 |
|
| 199 |
-
#
|
| 200 |
analyze_button.click(
|
| 201 |
fn=analyze_tone,
|
| 202 |
-
inputs=[text_input,
|
| 203 |
outputs=[result_message, all_probs_output, plot_output, examples_output]
|
| 204 |
)
|
| 205 |
|
| 206 |
# Fix for tone_dropdown event handler
|
| 207 |
tone_dropdown.change(
|
| 208 |
fn=get_tone_examples,
|
| 209 |
-
inputs=
|
| 210 |
-
outputs=
|
| 211 |
)
|
| 212 |
|
| 213 |
# Add example inputs
|
|
|
|
| 196 |
label="Example texts with similar tone"
|
| 197 |
)
|
| 198 |
|
| 199 |
+
# Fix for the click event handler - properly list the inputs
|
| 200 |
analyze_button.click(
|
| 201 |
fn=analyze_tone,
|
| 202 |
+
inputs=[text_input, tone_dropdown], # Fixed: explicitly list both inputs
|
| 203 |
outputs=[result_message, all_probs_output, plot_output, examples_output]
|
| 204 |
)
|
| 205 |
|
| 206 |
# Fix for tone_dropdown event handler
|
| 207 |
tone_dropdown.change(
|
| 208 |
fn=get_tone_examples,
|
| 209 |
+
inputs=tone_dropdown, # This also needs to be fixed to be a list
|
| 210 |
+
outputs=examples_output
|
| 211 |
)
|
| 212 |
|
| 213 |
# Add example inputs
|