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