mskov commited on
Commit
02a7c9f
1 Parent(s): d7bfcf2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -121,7 +121,7 @@ def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, expli
121
  else:
122
  affirm = ""
123
 
124
- return toxicity_score, label_score_dict, transcribed_text, affirm
125
  # return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
126
 
127
  def positive_affirmations():
@@ -143,13 +143,12 @@ with gr.Blocks() as iface:
143
  sense_slider = gr.Slider(minimum=1, maximum=5, step=1.0, label="How readily do you want the tool to intervene? 1 = in extreme cases and 5 = at every opportunity")
144
  with gr.Column():
145
  aud_input = gr.Audio(source="upload", type="filepath", label="Upload Audio File")
146
- text = gr.Textbox(label="Enter Text", placeholder="Enter text here...")
147
  submit_btn = gr.Button(label="Run")
148
  with gr.Column():
149
- out_val = gr.Textbox()
150
- out_class = gr.Label()
151
- out_text = gr.Textbox()
152
- out_affirm = gr.Textbox()
153
- submit_btn.click(fn=classify_toxicity, inputs=[aud_input, text, anxiety_class, emo_class, explit_preference, sense_slider], outputs=[out_val, out_class, out_text, out_affirm])
154
 
155
  iface.launch()
 
121
  else:
122
  affirm = ""
123
 
124
+ return transcribed_text, toxicity_score, label_score_dict, affirm
125
  # return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
126
 
127
  def positive_affirmations():
 
143
  sense_slider = gr.Slider(minimum=1, maximum=5, step=1.0, label="How readily do you want the tool to intervene? 1 = in extreme cases and 5 = at every opportunity")
144
  with gr.Column():
145
  aud_input = gr.Audio(source="upload", type="filepath", label="Upload Audio File")
 
146
  submit_btn = gr.Button(label="Run")
147
  with gr.Column():
148
+ out_text = gr.Textbox(label="Transcribed Audio")
149
+ out_val = gr.Textbox(label="Overall Toxicity")
150
+ out_class = gr.Label(label="Toxicity Class Breakdown")
151
+ out_affirm = gr.Textbox(label="Automated Text Message")
152
+ submit_btn.click(fn=classify_toxicity, inputs=[aud_input, anxiety_class, emo_class, explit_preference, sense_slider], outputs=[out_text, out_val, out_class, out_affirm])
153
 
154
  iface.launch()