Spaces:
Runtime error
Runtime error
Commit
·
845a206
1
Parent(s):
17ef24f
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,11 @@
|
|
| 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 |
-
|
| 8 |
-
|
|
|
|
| 9 |
pred = pipe(audio)
|
| 10 |
return {dic["label"]: dic["score"] for dic in pred}
|
| 11 |
|
|
|
|
| 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 |
+
|
| 8 |
+
def classify_sentiment(audio):
|
| 9 |
+
pipe = pipeline("audio-classification", model="hackathon-pln-es/wav2vec2-base-finetuned-sentiment-classification-MESD")
|
| 10 |
pred = pipe(audio)
|
| 11 |
return {dic["label"]: dic["score"] for dic in pred}
|
| 12 |
|