wuming233 commited on
Commit
50471fc
1 Parent(s): 52cf196

Changed model to run on cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ class_names = ['cardboard', 'glass', 'metal', 'paper', 'plastic', 'trash']
10
 
11
  vit, vit_transform = create_vit(output_classes=len(class_names))
12
 
13
- vit.load_state_dict(torch.load(f="vit_b_16_dout0.3_10epochs.pth"))
14
 
15
  def predict(img) -> Tuple[Dict, float]:
16
  start_time = timer()
 
10
 
11
  vit, vit_transform = create_vit(output_classes=len(class_names))
12
 
13
+ vit.load_state_dict(torch.load(f="vit_b_16_dout0.3_10epochs.pth", map_location=torch.device("cpu")))
14
 
15
  def predict(img) -> Tuple[Dict, float]:
16
  start_time = timer()