Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import torch
|
|
4 |
import torchvision.transforms as transforms
|
5 |
|
6 |
inference_model = timm.create_model('swin_large_patch4_window7_224', pretrained=False, num_classes=101)
|
7 |
-
inference_model.load_state_dict(torch.load('model.pth'
|
8 |
inference_model.eval()
|
9 |
|
10 |
with open('labels.txt', 'r') as f:
|
|
|
4 |
import torchvision.transforms as transforms
|
5 |
|
6 |
inference_model = timm.create_model('swin_large_patch4_window7_224', pretrained=False, num_classes=101)
|
7 |
+
inference_model.load_state_dict(torch.load('model.pth', map_location=torch.device('cpu')))
|
8 |
inference_model.eval()
|
9 |
|
10 |
with open('labels.txt', 'r') as f:
|