fixed out of order error
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ import datetime
|
|
3 |
from transformers import pipeline
|
4 |
import gradio as gr
|
5 |
|
6 |
-
|
7 |
asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
|
8 |
|
9 |
classifier = pipeline("text-classification", model="bhadresh-savani/distilbert-base-uncased-emotion")
|
@@ -26,14 +25,11 @@ with demo:
|
|
26 |
|
27 |
audio_file = gr.inputs.Audio(source="microphone", type="filepath")
|
28 |
b1 = gr.Button("Recognize Speech")
|
29 |
-
b1.click(speech_to_text, inputs=audio_file, outputs=text)
|
30 |
text = gr.Textbox()
|
31 |
-
|
|
|
32 |
b2 = gr.Button("Classify Sentiment")
|
33 |
-
b2.click(text_to_sentiment, inputs=text, outputs=label)
|
34 |
label = gr.Label()
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
demo.launch(share=True)
|
|
|
3 |
from transformers import pipeline
|
4 |
import gradio as gr
|
5 |
|
|
|
6 |
asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
|
7 |
|
8 |
classifier = pipeline("text-classification", model="bhadresh-savani/distilbert-base-uncased-emotion")
|
|
|
25 |
|
26 |
audio_file = gr.inputs.Audio(source="microphone", type="filepath")
|
27 |
b1 = gr.Button("Recognize Speech")
|
|
|
28 |
text = gr.Textbox()
|
29 |
+
b1.click(speech_to_text, inputs=audio_file, outputs=text)
|
30 |
+
|
31 |
b2 = gr.Button("Classify Sentiment")
|
|
|
32 |
label = gr.Label()
|
33 |
+
b2.click(text_to_sentiment, inputs=text, outputs=label)
|
|
|
|
|
34 |
|
35 |
demo.launch(share=True)
|