sayakpaul HF Staff commited on
Commit
dfa0336
·
1 Parent(s): 0a8eb69

fix: prediction parsing.

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -112,7 +112,7 @@ def infer(video_file):
112
  with torch.no_grad():
113
  outputs = MODEL(**inputs)
114
  logits = outputs.logits
115
- softmax_scores = torch.nn.functional.softmax(logits, dim=0)
116
  confidences = {LABELS[i]: float(softmax_scores[i]) for i in range(len(LABELS))}
117
  return confidences
118
 
 
112
  with torch.no_grad():
113
  outputs = MODEL(**inputs)
114
  logits = outputs.logits
115
+ softmax_scores = torch.nn.functional.softmax(logits, dim=0).squeeze(0)
116
  confidences = {LABELS[i]: float(softmax_scores[i]) for i in range(len(LABELS))}
117
  return confidences
118