Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,31 @@
|
|
1 |
-
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
demo.launch()
|
|
|
1 |
+
#from transformers import pipeline
|
2 |
+
|
3 |
import gradio as gr
|
4 |
|
5 |
+
#asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
|
6 |
+
#classifier = pipeline("text-classification")
|
7 |
+
|
8 |
+
|
9 |
+
def speech_to_text():
|
10 |
+
text = 'running speech to text'
|
11 |
+
return text
|
12 |
+
|
13 |
+
|
14 |
+
def text_to_sentiment():
|
15 |
+
return 'running text to sentiment'
|
16 |
+
|
17 |
+
|
18 |
+
demo = gr.Blocks()
|
19 |
+
|
20 |
+
with demo:
|
21 |
+
audio_file = gr.File()
|
22 |
+
text = gr.Textbox()
|
23 |
+
label = gr.Label()
|
24 |
+
|
25 |
+
b1 = gr.Button("Recognize Speech")
|
26 |
+
b2 = gr.Button("Classify Sentiment")
|
27 |
+
|
28 |
+
b1.click(speech_to_text, inputs=audio_file, outputs=text)
|
29 |
+
b2.click(text_to_sentiment, inputs=text, outputs=label)
|
30 |
+
|
31 |
demo.launch()
|