Spaces:
Runtime error
Runtime error
fix: variable
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
| 38 |
img = densenet121_transforms(img).unsqueeze(0)
|
| 39 |
|
| 40 |
# Put model into evaluation mode and turn on inference mode
|
| 41 |
-
|
| 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(effnetb2(img), dim=1)
|
|
|
|
| 38 |
img = densenet121_transforms(img).unsqueeze(0)
|
| 39 |
|
| 40 |
# Put model into evaluation mode and turn on inference mode
|
| 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(effnetb2(img), dim=1)
|