saritha commited on
Commit
3a0ccc3
·
verified ·
1 Parent(s): 17d4c8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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