Spaces:
Build error
Build error
pass logits
Browse files
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))}
|