Spaces:
Runtime error
Runtime error
Commit ·
fcfe8bc
1
Parent(s): 67ef4bd
fix: bug fix model path
Browse files
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(
|
| 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([
|