Spaces:
Runtime error
Runtime error
Commit ·
67ef4bd
1
Parent(s): 8d61ee9
fix: adding auth
Browse files
app.py
CHANGED
|
@@ -4,10 +4,12 @@ import os
|
|
| 4 |
from torchvision import transforms
|
| 5 |
from huggingface_hub import hf_hub_download
|
| 6 |
|
|
|
|
| 7 |
|
|
|
|
| 8 |
REPO_ID = "gonzalocordova/DistractionDetectorCNN"
|
| 9 |
FILENAME = "model_with_extended_dataset_resnet50_2023-03-28_10-42-07.pth"
|
| 10 |
-
hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="model")
|
| 11 |
model = torch.load(os.path.join(os.getcwd(), FILENAME))
|
| 12 |
model.eval()
|
| 13 |
|
|
|
|
| 4 |
from torchvision import transforms
|
| 5 |
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 |
|