Abdul Rafay commited on
Commit
93d71bf
·
1 Parent(s): 5b24e3f

fixed model loading

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -38,7 +38,7 @@ async def predict(file: UploadFile = File(...)):
38
  # -----------------------
39
  device = torch.device("cpu")
40
  model = Model().to(device)
41
- model.load_state_dict(torch.load(MODEL_PATH, map_location=device))
42
  model.eval()
43
 
44
  image_bytes = await file.read()
 
38
  # -----------------------
39
  device = torch.device("cpu")
40
  model = Model().to(device)
41
+ model = torch.load(MODEL_PATH, map_location=device)
42
  model.eval()
43
 
44
  image_bytes = await file.read()