Spaces:
Runtime error
Runtime error
Fixing result error
Browse files
app.py
CHANGED
|
@@ -20,8 +20,10 @@ def predict(text):
|
|
| 20 |
|
| 21 |
outputs = model(**inputs)
|
| 22 |
predictions = outputs.logits
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
iface = gr.Interface(
|
| 27 |
title="Identificador de emoções em uma frase",
|
|
|
|
| 20 |
|
| 21 |
outputs = model(**inputs)
|
| 22 |
predictions = outputs.logits
|
| 23 |
+
result = predictions.item()
|
| 24 |
+
result = max(result, 0)
|
| 25 |
+
result = min(result, 5)
|
| 26 |
+
return mapping[round(result)]
|
| 27 |
|
| 28 |
iface = gr.Interface(
|
| 29 |
title="Identificador de emoções em uma frase",
|