LukeOLuck commited on
Commit
956e5dc
·
1 Parent(s): 6dae516

pass logits

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -32,7 +32,7 @@ def predict(img) -> Tuple[Dict, float]:
32
  model.eval()
33
  with torch.inference_mode():
34
  # Pass transformed image through the model and turn the prediction logits into probaiblities
35
- pred_probs = torch.softmax(model(img), dim=1)
36
 
37
  # Create a prediction label and prediction probability dictionary
38
  pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
 
32
  model.eval()
33
  with torch.inference_mode():
34
  # Pass transformed image through the model and turn the prediction logits into probaiblities
35
+ pred_probs = torch.softmax(model(img).logits, dim=1)
36
 
37
  # Create a prediction label and prediction probability dictionary
38
  pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}