Spaces:
Sleeping
Sleeping
change model load
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import torch
|
|
| 4 |
|
| 5 |
model = timm.create_model("mobileone_s2", pretrained = False)
|
| 6 |
model.head.fc = torch.nn.Linear(model.head.fc.in_features,3)
|
| 7 |
-
model.load_state_dict(torch.load("olive-classifier.pth", weights_only=True))
|
| 8 |
model.eval()
|
| 9 |
|
| 10 |
categories = ("Aculus Olearius", "Healthy", "Peacock Spot")
|
|
|
|
| 4 |
|
| 5 |
model = timm.create_model("mobileone_s2", pretrained = False)
|
| 6 |
model.head.fc = torch.nn.Linear(model.head.fc.in_features,3)
|
| 7 |
+
model.load_state_dict(torch.load("olive-classifier.pth", map_location=torch.device('cpu'), weights_only=True))
|
| 8 |
model.eval()
|
| 9 |
|
| 10 |
categories = ("Aculus Olearius", "Healthy", "Peacock Spot")
|