MarkusWesterwald commited on
Commit
f9f1643
1 Parent(s): a50b214

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +4 -4
handler.py CHANGED
@@ -84,7 +84,7 @@ class EndpointHandler:
84
  # run normal prediction
85
  scores = self.model.predict_proba(inputs)[0]
86
 
87
- # get index of element with highest score
88
- max_index = scores.argmax()
89
-
90
- return {"label": self.id2label[max_index], "score": scores[max_index].item()}
 
84
  # run normal prediction
85
  scores = self.model.predict_proba(inputs)[0]
86
 
87
+ return [
88
+ {"label": self.id2label[i], "score": score.item()}
89
+ for i, score in enumerate(scores)
90
+ ]