King-8 commited on
Commit
a471ca8
·
verified ·
1 Parent(s): 2e88ae2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
  }