Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def suppress_stdout():
|
|
26 |
# Load the saved model and suppress the warnings
|
27 |
with suppress_stdout():
|
28 |
model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224-in21k', num_labels=6)
|
29 |
-
model.load_state_dict(torch.load('vit_sugarcane_disease_detection.pth'))
|
30 |
model.eval()
|
31 |
|
32 |
# Define the same transformation used during training
|
|
|
26 |
# Load the saved model and suppress the warnings
|
27 |
with suppress_stdout():
|
28 |
model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224-in21k', num_labels=6)
|
29 |
+
model.load_state_dict(torch.load('vit_sugarcane_disease_detection.pth', map_location=torch.device('cpu')))
|
30 |
model.eval()
|
31 |
|
32 |
# Define the same transformation used during training
|