Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def predict_emotion_from_audio(wav_filepath):
|
|
44 |
print("Error predicting emotion:", e)
|
45 |
return None
|
46 |
|
47 |
-
#
|
48 |
def get_predictions(audio_input):
|
49 |
emotion_prediction = predict_emotion_from_audio(audio_input)
|
50 |
return [emotion_prediction]
|
@@ -57,7 +57,7 @@ with gr.Blocks() as interface:
|
|
57 |
with gr.Row():
|
58 |
input_audio = gr.Audio(label="Input Audio", type="filepath")
|
59 |
submit_button = gr.Button("Submit")
|
60 |
-
output_labels = [gr.Label(
|
61 |
|
62 |
# Set the function to be called when the button is clicked
|
63 |
submit_button.click(get_predictions, inputs=input_audio, outputs=output_labels)
|
|
|
44 |
print("Error predicting emotion:", e)
|
45 |
return None
|
46 |
|
47 |
+
# Predict emotion from audio
|
48 |
def get_predictions(audio_input):
|
49 |
emotion_prediction = predict_emotion_from_audio(audio_input)
|
50 |
return [emotion_prediction]
|
|
|
57 |
with gr.Row():
|
58 |
input_audio = gr.Audio(label="Input Audio", type="filepath")
|
59 |
submit_button = gr.Button("Submit")
|
60 |
+
output_labels = [gr.Label(emotion_prediction)]
|
61 |
|
62 |
# Set the function to be called when the button is clicked
|
63 |
submit_button.click(get_predictions, inputs=input_audio, outputs=output_labels)
|