Spaces:
Runtime error
Runtime error
Commit
·
87d2c68
1
Parent(s):
5c183fe
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ def translate_and_classify(audio):
|
|
| 40 |
print("Translated: " + translation.text)
|
| 41 |
|
| 42 |
emotion = emotion_classifier(translation.text)
|
| 43 |
-
detected_emotion = emotion[0][
|
| 44 |
print("Detected Emotions are", detected_emotion)
|
| 45 |
return transcription.text, detected_emotion
|
| 46 |
|
|
@@ -142,7 +142,7 @@ with gr.Blocks(css = css) as demo:
|
|
| 142 |
|
| 143 |
with gr.Row():
|
| 144 |
transcript_output = gr.Textbox(label="Transcription in the language you spoke", lines = 3)
|
| 145 |
-
emotion_output = gr.
|
| 146 |
|
| 147 |
transcribe_audio.click(translate_and_classify, inputs = audio_input, outputs = [transcript_output,emotion_output])
|
| 148 |
|
|
|
|
| 40 |
print("Translated: " + translation.text)
|
| 41 |
|
| 42 |
emotion = emotion_classifier(translation.text)
|
| 43 |
+
detected_emotion = emotion[0]["label"]
|
| 44 |
print("Detected Emotions are", detected_emotion)
|
| 45 |
return transcription.text, detected_emotion
|
| 46 |
|
|
|
|
| 142 |
|
| 143 |
with gr.Row():
|
| 144 |
transcript_output = gr.Textbox(label="Transcription in the language you spoke", lines = 3)
|
| 145 |
+
emotion_output = gr.Textbox(label = "Detected Emotion")
|
| 146 |
|
| 147 |
transcribe_audio.click(translate_and_classify, inputs = audio_input, outputs = [transcript_output,emotion_output])
|
| 148 |
|