Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -160,10 +160,10 @@ def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, expli
|
|
160 |
def intervention_output(intervene):
|
161 |
if intervene == "Audio File":
|
162 |
print("audio updated")
|
163 |
-
return { output_col : gr.update(visible=True), out_aud : gr.update(value="calm.wav", visible=True, autoplay=True)}
|
164 |
elif intervene == "Therapy App":
|
165 |
print("therapy app updated")
|
166 |
-
return { output_col : gr.update(visible=True), out_img : gr.update(value="hrv-breathing.gif", visible=True)}
|
167 |
elif intervene == "Text Message":
|
168 |
phrase = positive_affirmations()
|
169 |
return { output_col : gr.update(visible=True), out_text : gr.update(value=phrase, visible=True)}
|
@@ -197,8 +197,8 @@ with gr.Blocks() as iface:
|
|
197 |
out_class = gr.Textbox()
|
198 |
with gr.Column(visible=False) as output_col:
|
199 |
out_text = gr.Textbox()
|
200 |
-
out_img = gr.Image(value="hrv-breathing.gif")
|
201 |
-
out_aud = gr.Audio(value="calm.wav")
|
202 |
submit_btn.click(fn=classify_toxicity, inputs=[aud_input, text, anxiety_class, emo_class, explit_preference, sense_slider, intervention_type], outputs=[out_val, out_class, out_text, output_col])
|
203 |
|
204 |
iface.launch()
|
|
|
160 |
def intervention_output(intervene):
|
161 |
if intervene == "Audio File":
|
162 |
print("audio updated")
|
163 |
+
return { output_col : gr.update(visible=True), out_aud : gr.update(value="./calm.wav", visible=True, autoplay=True)}
|
164 |
elif intervene == "Therapy App":
|
165 |
print("therapy app updated")
|
166 |
+
return { output_col : gr.update(visible=True), out_img : gr.update(value="./hrv-breathing.gif", visible=True)}
|
167 |
elif intervene == "Text Message":
|
168 |
phrase = positive_affirmations()
|
169 |
return { output_col : gr.update(visible=True), out_text : gr.update(value=phrase, visible=True)}
|
|
|
197 |
out_class = gr.Textbox()
|
198 |
with gr.Column(visible=False) as output_col:
|
199 |
out_text = gr.Textbox()
|
200 |
+
out_img = gr.Image(value="./hrv-breathing.gif")
|
201 |
+
out_aud = gr.Audio(value="./calm.wav")
|
202 |
submit_btn.click(fn=classify_toxicity, inputs=[aud_input, text, anxiety_class, emo_class, explit_preference, sense_slider, intervention_type], outputs=[out_val, out_class, out_text, output_col])
|
203 |
|
204 |
iface.launch()
|