Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ encode = lambda s: [stoi[c] for c in s] # encoder: take a string, output a list
|
|
| 20 |
decode = lambda l: ''.join([itos[i] for i in l]) # decoder: take a list of integers, output a string
|
| 21 |
|
| 22 |
# load model
|
| 23 |
-
model_spec = torch.load("ckpt.pt")
|
| 24 |
model_args = model_spec['model_args']
|
| 25 |
model_weights = model_spec['model']
|
| 26 |
modelconf = ModelConfig(**model_args)
|
|
|
|
| 20 |
decode = lambda l: ''.join([itos[i] for i in l]) # decoder: take a list of integers, output a string
|
| 21 |
|
| 22 |
# load model
|
| 23 |
+
model_spec = torch.load("ckpt.pt", map_location=torch.device('cpu'))
|
| 24 |
model_args = model_spec['model_args']
|
| 25 |
model_weights = model_spec['model']
|
| 26 |
modelconf = ModelConfig(**model_args)
|