service-internal commited on
Commit
98a42e2
·
verified ·
1 Parent(s): 58ca4fd

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -56,7 +56,7 @@ async def analyze(request: Request):
56
 
57
  # Build the result using fixed order
58
  result = [
59
- {"label": config.id2label[i], "score": round(float(probs[i]), 4)}
60
  for label in fixed_order
61
  ]
62
 
 
56
 
57
  # Build the result using fixed order
58
  result = [
59
+ {"label": label, "score": round(float(probs[config.label2id[label]]), 4)}
60
  for label in fixed_order
61
  ]
62