Update app.py
Browse files
app.py
CHANGED
|
@@ -116,7 +116,7 @@ def load_model():
|
|
| 116 |
logger.info(f"Loading model from {config.MODEL_PATH}")
|
| 117 |
model = PlantDiseaseModel(num_classes=len(config.CLASS_NAMES), dropout=0.4)
|
| 118 |
|
| 119 |
-
checkpoint = torch.load(config.MODEL_PATH, map_location=config.DEVICE)
|
| 120 |
model.load_state_dict(checkpoint['model_state_dict'])
|
| 121 |
model.to(config.DEVICE)
|
| 122 |
model.eval()
|
|
|
|
| 116 |
logger.info(f"Loading model from {config.MODEL_PATH}")
|
| 117 |
model = PlantDiseaseModel(num_classes=len(config.CLASS_NAMES), dropout=0.4)
|
| 118 |
|
| 119 |
+
checkpoint = torch.load(config.MODEL_PATH, map_location=config.DEVICE,weights_only=True)
|
| 120 |
model.load_state_dict(checkpoint['model_state_dict'])
|
| 121 |
model.to(config.DEVICE)
|
| 122 |
model.eval()
|