Dabs commited on
Commit
ed167eb
1 Parent(s): fc00e62

map location cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -11,7 +11,7 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
11
  #intialize the model
12
  model = models.model(pretrained=False, requires_grad=False).to(device)
13
  # load the model checkpoint
14
- checkpoint = torch.load('model.pth')
15
  # load model weights state_dict
16
  model.load_state_dict(checkpoint['model_state_dict'])
17
  model.eval()
 
11
  #intialize the model
12
  model = models.model(pretrained=False, requires_grad=False).to(device)
13
  # load the model checkpoint
14
+ checkpoint = torch.load('model.pth', map_location=device)
15
  # load model weights state_dict
16
  model.load_state_dict(checkpoint['model_state_dict'])
17
  model.eval()