gonzalocordova commited on
Commit
fcfe8bc
·
1 Parent(s): 67ef4bd

fix: bug fix model path

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,11 +6,11 @@ from huggingface_hub import hf_hub_download
6
 
7
  token = "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"
8
 
9
- # Download model from HuggingFace Hub¡
10
  REPO_ID = "gonzalocordova/DistractionDetectorCNN"
11
  FILENAME = "model_with_extended_dataset_resnet50_2023-03-28_10-42-07.pth"
12
- hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="model", use_auth_token=token)
13
- model = torch.load(os.path.join(os.getcwd(), FILENAME))
14
  model.eval()
15
 
16
  transform = transforms.Compose([
 
6
 
7
  token = "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"
8
 
9
+ # Download model from HuggingFace Hub and load it with PyTorch
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([