Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
classifier = pipeline("text-classification",model='bhadresh-savani/distilbert-base-uncased-emotion', return_all_scores=True)
|
5 |
-
output = {}
|
6 |
|
7 |
def detect_emotions(emotion_input):
|
8 |
prediction = classifier(emotion_input,)
|
|
|
9 |
for emotion in prediction[0]:
|
10 |
output[emotion["label"]] = emotion["score"]
|
11 |
return output
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
classifier = pipeline("text-classification",model='bhadresh-savani/distilbert-base-uncased-emotion', return_all_scores=True)
|
|
|
5 |
|
6 |
def detect_emotions(emotion_input):
|
7 |
prediction = classifier(emotion_input,)
|
8 |
+
output = {}
|
9 |
for emotion in prediction[0]:
|
10 |
output[emotion["label"]] = emotion["score"]
|
11 |
return output
|