anon5 commited on
Commit
0689faa
·
verified ·
1 Parent(s): b7a4dc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,11 +10,11 @@ CLASSES = ['guro', 'pigs', 'proofs', 'protyk', 'safe', 'shit']
10
  NUM_CLASSES = len(CLASSES)
11
 
12
  #device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
13
- device = 'cpu'
14
 
15
  model = models.resnet18(pretrained=True)
16
  model.fc = nn.Linear(model.fc.in_features, NUM_CLASSES)
17
- model.load_state_dict(torch.load('best_model.pth'))
18
  model.to(device)
19
  model.eval()
20
 
 
10
  NUM_CLASSES = len(CLASSES)
11
 
12
  #device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
13
+ device = torch.device('cpu')
14
 
15
  model = models.resnet18(pretrained=True)
16
  model.fc = nn.Linear(model.fc.in_features, NUM_CLASSES)
17
+ model.load_state_dict(torch.load('best_model.pth', location=device))
18
  model.to(device)
19
  model.eval()
20