Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ model.fc = nn.Linear(num_features, num_classes)
|
|
12 |
|
13 |
# Load the trained model weights
|
14 |
try:
|
15 |
-
model.load_state_dict(torch.load("
|
16 |
print("Model loaded successfully.")
|
17 |
except Exception as e:
|
18 |
print(f"Error loading model: {e}")
|
|
|
12 |
|
13 |
# Load the trained model weights
|
14 |
try:
|
15 |
+
model.load_state_dict(torch.load("best_model.pth", map_location=torch.device('cpu')))
|
16 |
print("Model loaded successfully.")
|
17 |
except Exception as e:
|
18 |
print(f"Error loading model: {e}")
|