Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from PIL import Image
|
|
| 8 |
from torchvision import models
|
| 9 |
model = models.resnet18()
|
| 10 |
model.fc = torch.nn.Linear(model.fc.in_features, 2)
|
| 11 |
-
model.load_state_dict(torch.load("
|
| 12 |
model.eval()
|
| 13 |
|
| 14 |
# 2. Define labels based on your dataset folders
|
|
|
|
| 8 |
from torchvision import models
|
| 9 |
model = models.resnet18()
|
| 10 |
model.fc = torch.nn.Linear(model.fc.in_features, 2)
|
| 11 |
+
model.load_state_dict(torch.load("fine_tuned_model.pt", map_location="cpu"))
|
| 12 |
model.eval()
|
| 13 |
|
| 14 |
# 2. Define labels based on your dataset folders
|