anjikum commited on
Commit
44d2b34
·
verified ·
1 Parent(s): 1b084ff

made changes to model loading

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -36,7 +36,7 @@ model.to(device) # Move model to CPU (even if you have a GPU)
36
  checkpoint = torch.load('model.pth', map_location='cpu')
37
 
38
  # Load the model weights
39
- model.load_state_dict(checkpoint['model_state_dict'])
40
 
41
  # If you need to resume training, load optimizer and scheduler states
42
  optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
 
36
  checkpoint = torch.load('model.pth', map_location='cpu')
37
 
38
  # Load the model weights
39
+ model.load_state_dict(checkpoint['model_state_dict'], strict=False)
40
 
41
  # If you need to resume training, load optimizer and scheduler states
42
  optimizer.load_state_dict(checkpoint['optimizer_state_dict'])