Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
36 |
vit.eval()
|
37 |
with torch.inference_mode():
|
38 |
# Pass transformed image through the model and turn the prediction logits into probaiblities
|
39 |
-
pred_probs = torch.softmax(
|
40 |
|
41 |
# Create a prediction label and prediction probability dictionary
|
42 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|
|
|
36 |
vit.eval()
|
37 |
with torch.inference_mode():
|
38 |
# Pass transformed image through the model and turn the prediction logits into probaiblities
|
39 |
+
pred_probs = torch.softmax(vit(img), dim=1)
|
40 |
|
41 |
# Create a prediction label and prediction probability dictionary
|
42 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|