SANJAYV10 commited on
Commit
e2a4769
1 Parent(s): e9d559f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ class Prediction:
10
  prediction: TorchTensor
11
 
12
  app = fastapi.FastAPI(docs_url="/")
13
- pre_trained_model = torch.load('best_model.pth')
14
 
15
  # Get the state dictionary of the pre-trained model
16
  state_dict = pre_trained_model['model_state_dict']
 
10
  prediction: TorchTensor
11
 
12
  app = fastapi.FastAPI(docs_url="/")
13
+ pre_trained_model = torch.load('best_model.pth',map_location=torch.device('cpu'))
14
 
15
  # Get the state dictionary of the pre-trained model
16
  state_dict = pre_trained_model['model_state_dict']