Spaces:
Runtime error
Runtime error
Commit
·
8b338c8
1
Parent(s):
354025a
Include emotion
Browse files
app.py
CHANGED
@@ -39,9 +39,9 @@ def translate_and_classify(audio):
|
|
39 |
print("Transcript: " + transcription.text)
|
40 |
print("Translated: " + translation.text)
|
41 |
|
42 |
-
|
43 |
|
44 |
-
return transcription.text
|
45 |
|
46 |
with gr.Blocks() as demo:
|
47 |
gr.Markdown("""
|
@@ -56,9 +56,11 @@ with gr.Blocks() as demo:
|
|
56 |
transcribe_audio = gr.Button('Transcribe')
|
57 |
|
58 |
with gr.Column():
|
59 |
-
|
|
|
|
|
60 |
|
61 |
-
transcribe_audio.click(translate_and_classify, inputs = audio_input, outputs = transcript_output)
|
62 |
|
63 |
|
64 |
demo.launch()
|
|
|
39 |
print("Transcript: " + transcription.text)
|
40 |
print("Translated: " + translation.text)
|
41 |
|
42 |
+
emotion = emotion_classifier(translation.text)
|
43 |
|
44 |
+
return transcription.text, emotion
|
45 |
|
46 |
with gr.Blocks() as demo:
|
47 |
gr.Markdown("""
|
|
|
56 |
transcribe_audio = gr.Button('Transcribe')
|
57 |
|
58 |
with gr.Column():
|
59 |
+
with gr.Row():
|
60 |
+
transcript_output = gr.Textbox(label="Transcription in the language you spoke", lines = 3)
|
61 |
+
emotion_output = gr.Textbox(label = "Detected Emotion")
|
62 |
|
63 |
+
transcribe_audio.click(translate_and_classify, inputs = audio_input, outputs = [transcript_output,emotion_output])
|
64 |
|
65 |
|
66 |
demo.launch()
|