Spaces:
Runtime error
Runtime error
DrishtiSharma
commited on
Commit
•
ce85da2
1
Parent(s):
09be0ba
Upload app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
4 |
#Model_1 = "hackathon-pln-es/wav2vec2-base-finetuned-sentiment-classification-MESD"
|
5 |
#Model_2 ="hackathon-pln-es/wav2vec2-base-finetuned-sentiment-mesd"
|
6 |
|
@@ -16,7 +19,7 @@ label = gr.outputs.Label(num_top_classes=5)
|
|
16 |
|
17 |
################### Gradio Web APP ################################
|
18 |
|
19 |
-
title = "Audio Sentiment Classifier"
|
20 |
|
21 |
description = """
|
22 |
<p>
|
@@ -33,11 +36,15 @@ This application classifies the sentiment of the audio input provided by the use
|
|
33 |
|
34 |
|
35 |
|
36 |
-
gr.Interface(
|
37 |
-
fn = classify_sentiment,
|
38 |
-
inputs = input_audio,
|
39 |
-
outputs = label,
|
40 |
-
examples=[["basta_neutral.wav"], ["detras_disgust.wav"], ["mortal_sadness.wav"], ["respiracion_happiness.wav"], ["robo_fear.wav"]],
|
41 |
-
title = "🔊 Audio Sentiment Classifier",
|
42 |
-
description = "Demostración de Gradio para la clasificación de sentimientos de audios usando Wav2Vec2",
|
43 |
-
theme="huggingface").launch()
|
|
|
|
|
|
|
|
|
|
1 |
+
from reader import get_article
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
info = get_article()
|
6 |
+
|
7 |
#Model_1 = "hackathon-pln-es/wav2vec2-base-finetuned-sentiment-classification-MESD"
|
8 |
#Model_2 ="hackathon-pln-es/wav2vec2-base-finetuned-sentiment-mesd"
|
9 |
|
|
|
19 |
|
20 |
################### Gradio Web APP ################################
|
21 |
|
22 |
+
#title = "Audio Sentiment Classifier"
|
23 |
|
24 |
description = """
|
25 |
<p>
|
|
|
36 |
|
37 |
|
38 |
|
39 |
+
#gr.Interface(
|
40 |
+
#fn = classify_sentiment,
|
41 |
+
#inputs = input_audio,
|
42 |
+
#outputs = label,
|
43 |
+
#examples=[["basta_neutral.wav"], ["detras_disgust.wav"], ["mortal_sadness.wav"], ["respiracion_happiness.wav"], ["robo_fear.wav"]],
|
44 |
+
#title = "🔊 Audio Sentiment Classifier",
|
45 |
+
#description = "Demostración de Gradio para la clasificación de sentimientos de audios usando Wav2Vec2",
|
46 |
+
#theme="huggingface").launch()
|
47 |
+
|
48 |
+
# generate and launch interface
|
49 |
+
interface = gr.Interface(fn=classify_sentiment, inputs=input_audio, outputs=label, examples=[["basta_neutral.wav"], ["detras_disgust.wav"], ["mortal_sadness.wav"], ["respiracion_happiness.wav"], ["robo_fear.wav"]], article=info['article'], css=info['css'], theme='huggingface', title=info['title'], allow_flagging='never', description=info['description'])
|
50 |
+
interface.launch()
|