allispaul commited on
Commit
123e402
1 Parent(s): 3119e39

load on cpu

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -17,8 +17,7 @@ device = "cpu"
17
  effnetb2, effnetb2_transforms = create_effnetb2_model(num_classes=len(class_names))
18
 
19
  # Load saved weights
20
- effnetb2.load_state_dict(torch.load("effnetb2.pth"),
21
- map_location=torch.device(device))
22
 
23
  # Define predict function
24
  def predict(img: Image) -> Tuple[dict, float]:
@@ -60,4 +59,4 @@ demo = gr.Interface(
60
  article=article,
61
  )
62
 
63
- demo.lauch()
 
17
  effnetb2, effnetb2_transforms = create_effnetb2_model(num_classes=len(class_names))
18
 
19
  # Load saved weights
20
+ effnetb2.load_state_dict(torch.load("effnetb2.pth", map_location=torch.device(device)))
 
21
 
22
  # Define predict function
23
  def predict(img: Image) -> Tuple[dict, float]:
 
59
  article=article,
60
  )
61
 
62
+ demo.lauch()