Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
12 |
# Define the model architecture
|
13 |
model = models.resnet152()
|
14 |
model.fc = torch.nn.Linear(model.fc.in_features, 26) # Adjust for the number of classes
|
15 |
-
model.load_state_dict(torch.load("
|
16 |
model = model.to(device)
|
17 |
model.eval()
|
18 |
|
|
|
12 |
# Define the model architecture
|
13 |
model = models.resnet152()
|
14 |
model.fc = torch.nn.Linear(model.fc.in_features, 26) # Adjust for the number of classes
|
15 |
+
model.load_state_dict(torch.load("trained_model.pth", map_location=device))
|
16 |
model = model.to(device)
|
17 |
model.eval()
|
18 |
|