Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,11 @@ NUM_CLASSES = len(classes)
|
|
| 17 |
|
| 18 |
# Load model
|
| 19 |
model = FoodIngredientClassifier(NUM_CLASSES)
|
| 20 |
-
checkpoint = torch.load(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
model.load_state_dict(checkpoint["model_state_dict"])
|
| 22 |
model.to(DEVICE)
|
| 23 |
model.eval()
|
|
|
|
| 17 |
|
| 18 |
# Load model
|
| 19 |
model = FoodIngredientClassifier(NUM_CLASSES)
|
| 20 |
+
checkpoint = torch.load(
|
| 21 |
+
"best_model.pth",
|
| 22 |
+
map_location=DEVICE,
|
| 23 |
+
weights_only=False
|
| 24 |
+
)
|
| 25 |
model.load_state_dict(checkpoint["model_state_dict"])
|
| 26 |
model.to(DEVICE)
|
| 27 |
model.eval()
|