Update app.py
Browse files
app.py
CHANGED
|
@@ -40,8 +40,7 @@ def load_model(repo_id):
|
|
| 40 |
# Initialize the ResNet-18 architecture
|
| 41 |
model = torchvision.models.resnet18(pretrained=False)
|
| 42 |
num_ftrs = model.fc.in_features
|
| 43 |
-
model.fc = nn.Linear(num_ftrs, 100) # Adjust for your
|
| 44 |
-
# TODO: check if this number^^ corresponds to the number of classes
|
| 45 |
|
| 46 |
# Load the model weights
|
| 47 |
state_dict = torch.load(weights_path, map_location=torch.device("cpu"))
|
|
|
|
| 40 |
# Initialize the ResNet-18 architecture
|
| 41 |
model = torchvision.models.resnet18(pretrained=False)
|
| 42 |
num_ftrs = model.fc.in_features
|
| 43 |
+
model.fc = nn.Linear(num_ftrs, 100) # Adjust for your number of classes
|
|
|
|
| 44 |
|
| 45 |
# Load the model weights
|
| 46 |
state_dict = torch.load(weights_path, map_location=torch.device("cpu"))
|