Spaces:
Runtime error
Runtime error
Commit
·
e6f6f59
1
Parent(s):
6d7113f
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,14 @@
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
|
|
|
6 |
def classify_sentiment(audio, model):
|
7 |
pipe = pipeline("audio-classification", model=model)
|
8 |
pred = pipe(audio)
|
9 |
return {dic["label"]: dic["score"] for dic in pred}
|
10 |
|
11 |
-
input_audio = [gr.inputs.Audio(source="microphone", type="filepath", label="Record/ Drop audio"), gr.inputs.Dropdown([
|
12 |
label = gr.outputs.Label(num_top_classes=5)
|
13 |
|
14 |
################### Gradio Web APP ################################
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
Model_1 = "hackathon-pln-es/wav2vec2-base-finetuned-sentiment-classification-MESD"
|
6 |
+
Model_2 ="hackathon-pln-es/wav2vec2-base-finetuned-sentiment-mesd"
|
7 |
def classify_sentiment(audio, model):
|
8 |
pipe = pipeline("audio-classification", model=model)
|
9 |
pred = pipe(audio)
|
10 |
return {dic["label"]: dic["score"] for dic in pred}
|
11 |
|
12 |
+
input_audio = [gr.inputs.Audio(source="microphone", type="filepath", label="Record/ Drop audio"), gr.inputs.Dropdown([Model_1, Model_2], label="Model Name")]
|
13 |
label = gr.outputs.Label(num_top_classes=5)
|
14 |
|
15 |
################### Gradio Web APP ################################
|