Agnist commited on
Commit
efbb21f
·
verified ·
1 Parent(s): db2468f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- # Set up event handlers - Fix for NoneType error by providing proper arguments
200
  analyze_button.click(
201
  fn=analyze_tone,
202
- inputs=[text_input, None], # Fixed: passing None for selected_tone parameter
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],
210
- outputs=[examples_output]
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