sayakpaul HF staff commited on
Commit
c5a535e
1 Parent(s): 33da5d3

debugging predictions.

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -114,7 +114,7 @@ def infer(video_file):
114
  logits = outputs.logits
115
  predicted_label = logits.argmax(-1).item()
116
  print(f"Predicted class: {MODEL.config.id2label[predicted_label]}")
117
- softmax_scores = torch.nn.functional.softmax(logits, dim=0).squeeze(0)
118
  print(f"Softmax scores: {softmax_scores}.")
119
  confidences = {LABELS[i]: float(softmax_scores[i]) for i in range(len(LABELS))}
120
  print(f"Confidence dict: {confidences}")
 
114
  logits = outputs.logits
115
  predicted_label = logits.argmax(-1).item()
116
  print(f"Predicted class: {MODEL.config.id2label[predicted_label]}")
117
+ softmax_scores = torch.nn.functional.softmax(logits, dim=-1).squeeze(0)
118
  print(f"Softmax scores: {softmax_scores}.")
119
  confidences = {LABELS[i]: float(softmax_scores[i]) for i in range(len(LABELS))}
120
  print(f"Confidence dict: {confidences}")