Spaces:
Runtime error
Runtime error
Commit
·
dafd3fc
1
Parent(s):
52deb65
Update app.py
Browse files
app.py
CHANGED
@@ -3,18 +3,18 @@ from transformers import pipeline
|
|
3 |
|
4 |
|
5 |
|
6 |
-
#def classify_sentiment(audio, model):
|
7 |
-
#pipe = pipeline("audio-classification", model=model)
|
8 |
-
#sentiment_classifier = pipe(audio)
|
9 |
-
#return sentiment_classifier
|
10 |
-
|
11 |
def classify_sentiment(audio, model):
|
12 |
pipe = pipeline("audio-classification", model=model)
|
13 |
sentiment_classifier = pipe(audio)
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
preds_dict={}
|
16 |
-
for sentiment_classifier in preds[0]:
|
17 |
-
preds_dict[pred['label']] = pred['score']
|
18 |
|
19 |
return preds_dict
|
20 |
|
|
|
3 |
|
4 |
|
5 |
|
|
|
|
|
|
|
|
|
|
|
6 |
def classify_sentiment(audio, model):
|
7 |
pipe = pipeline("audio-classification", model=model)
|
8 |
sentiment_classifier = pipe(audio)
|
9 |
+
return sentiment_classifier
|
10 |
+
|
11 |
+
#def classify_sentiment(audio, model):
|
12 |
+
#pipe = pipeline("audio-classification", model=model)
|
13 |
+
#sentiment_classifier = pipe(audio)
|
14 |
|
15 |
+
#preds_dict={}
|
16 |
+
#for sentiment_classifier in preds[0]:
|
17 |
+
#preds_dict[pred['label']] = pred['score']
|
18 |
|
19 |
return preds_dict
|
20 |
|