Anish13 commited on
Commit
f3883fb
·
1 Parent(s): ef7d690

fixed torch.load

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -169,7 +169,7 @@ model = BigramLanguageModel()
169
  checkpoint_path = 'checkpoint.pth'
170
 
171
  # Load the model checkpoint
172
- checkpoint = torch.load(checkpoint_path)
173
  model.load_state_dict(checkpoint['model_state_dict'])
174
  model.eval()
175
  model.to(device)
 
169
  checkpoint_path = 'checkpoint.pth'
170
 
171
  # Load the model checkpoint
172
+ checkpoint = torch.load(checkpoint_path, map_location=torch.device(device))
173
  model.load_state_dict(checkpoint['model_state_dict'])
174
  model.eval()
175
  model.to(device)