SANJAYV10 commited on
Commit
2177f90
1 Parent(s): e2a4769

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -10,13 +10,10 @@ class Prediction:
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']
17
 
18
- # Load the state dictionary into the current model
19
- model = pre_trained_model
20
  # Define a function to preprocess the input image
21
  def preprocess_input(input: fastapi.UploadFile):
22
  image = Image.open(input.file)
 
10
  prediction: TorchTensor
11
 
12
  app = fastapi.FastAPI(docs_url="/")
 
13
 
14
+ # Load the pre-trained model
15
+ pre_trained_model = torch.load('best_model.pth', map_location=torch.device('cpu'))
16
 
 
 
17
  # Define a function to preprocess the input image
18
  def preprocess_input(input: fastapi.UploadFile):
19
  image = Image.open(input.file)