Upload model.py with huggingface_hub
Browse files
model.py
CHANGED
|
@@ -13,7 +13,7 @@ def load_model(repo_id):
|
|
| 13 |
weights_path = hf_hub_download(repo_id=model_repo_id, filename=weight_file_id)
|
| 14 |
|
| 15 |
# Initialize the ResNet-18 architecture
|
| 16 |
-
model = torchvision.models.resnet18(pretrained=
|
| 17 |
num_ftrs = model.fc.in_features
|
| 18 |
model.fc = nn.Linear(num_ftrs, 100) # Adjust for your task (e.g., 128 classes)
|
| 19 |
|
|
|
|
| 13 |
weights_path = hf_hub_download(repo_id=model_repo_id, filename=weight_file_id)
|
| 14 |
|
| 15 |
# Initialize the ResNet-18 architecture
|
| 16 |
+
model = torchvision.models.resnet18(pretrained=False)
|
| 17 |
num_ftrs = model.fc.in_features
|
| 18 |
model.fc = nn.Linear(num_ftrs, 100) # Adjust for your task (e.g., 128 classes)
|
| 19 |
|