oracat commited on
Commit
c8064dd
·
1 Parent(s): 830ecde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -196,6 +196,9 @@ def top_pct(preds, threshold=0.95):
196
  cum_score += item["score"]
197
  if cum_score >= threshold:
198
  break
 
 
 
199
 
200
  preds = preds[: (i + 1)]
201
 
 
196
  cum_score += item["score"]
197
  if cum_score >= threshold:
198
  break
199
+ if item["score"] == 0:
200
+ i -= 1
201
+ break
202
 
203
  preds = preds[: (i + 1)]
204