gonzalocordova commited on
Commit
115c771
·
1 Parent(s): fcfe8bc

fix: setting torch device to cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ token = "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"
10
  REPO_ID = "gonzalocordova/DistractionDetectorCNN"
11
  FILENAME = "model_with_extended_dataset_resnet50_2023-03-28_10-42-07.pth"
12
  model_pth = hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="model", use_auth_token=token)
13
- model = torch.load(model_pth)
14
  model.eval()
15
 
16
  transform = transforms.Compose([
 
10
  REPO_ID = "gonzalocordova/DistractionDetectorCNN"
11
  FILENAME = "model_with_extended_dataset_resnet50_2023-03-28_10-42-07.pth"
12
  model_pth = hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="model", use_auth_token=token)
13
+ model = torch.load(model_pth, map_location=torch.device('cpu'))
14
  model.eval()
15
 
16
  transform = transforms.Compose([