Spaces:
Runtime error
Runtime error
fixed torch.load
Browse files
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)
|