Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,8 +34,9 @@ def predict(input: InputText):
|
|
| 34 |
|
| 35 |
probs = F.softmax(outputs.logits, dim=1)
|
| 36 |
predicted_class = probs.argmax().item()
|
|
|
|
| 37 |
|
| 38 |
return {
|
| 39 |
-
"label": labels[predicted_class]
|
|
|
|
| 40 |
}
|
| 41 |
-
|
|
|
|
| 34 |
|
| 35 |
probs = F.softmax(outputs.logits, dim=1)
|
| 36 |
predicted_class = probs.argmax().item()
|
| 37 |
+
confidence = probs.max().item()
|
| 38 |
|
| 39 |
return {
|
| 40 |
+
"label": labels[predicted_class],
|
| 41 |
+
"confidence": round(confidence, 4)
|
| 42 |
}
|
|
|