Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
|
|
| 7 |
model = GPT2LMHeadModel.from_pretrained('gpt2')
|
| 8 |
|
| 9 |
# Load the best model weights
|
| 10 |
-
model.load_state_dict(torch.load('
|
| 11 |
|
| 12 |
# Set the model to evaluation mode
|
| 13 |
model.eval()
|
|
|
|
| 7 |
model = GPT2LMHeadModel.from_pretrained('gpt2')
|
| 8 |
|
| 9 |
# Load the best model weights
|
| 10 |
+
model.load_state_dict(torch.load('GPT_model.pth', map_location=torch.device('cpu')))
|
| 11 |
|
| 12 |
# Set the model to evaluation mode
|
| 13 |
model.eval()
|