Spaces:
Sleeping
Sleeping
Commit
·
0bd26ab
1
Parent(s):
309e451
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
43 |
model.eval()
|
44 |
with torch.inference_mode():
|
45 |
# Pass the transformed image through the model and turn the prediction logits into prediction probabilities
|
46 |
-
pred_probs = torch.softmax(
|
47 |
|
48 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
49 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|
|
|
43 |
model.eval()
|
44 |
with torch.inference_mode():
|
45 |
# Pass the transformed image through the model and turn the prediction logits into prediction probabilities
|
46 |
+
pred_probs = torch.softmax(model(img), dim=1)
|
47 |
|
48 |
# Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
|
49 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|