Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def get_model():
|
|
| 10 |
model = GPT(GPTConfig())
|
| 11 |
# Load from the Hugging Face Hub instead of local file
|
| 12 |
model_path = 'mathminakshi/custom_gpt2'
|
| 13 |
-
model.load_state_dict(torch.hub.load_state_dict_from_url(f'https://huggingface.co/{model_path}/resolve/main/
|
| 14 |
model.eval()
|
| 15 |
return model
|
| 16 |
|
|
|
|
| 10 |
model = GPT(GPTConfig())
|
| 11 |
# Load from the Hugging Face Hub instead of local file
|
| 12 |
model_path = 'mathminakshi/custom_gpt2'
|
| 13 |
+
model.load_state_dict(torch.hub.load_state_dict_from_url(f'https://huggingface.co/{model_path}/resolve/main/model.pth', map_location='cpu'))
|
| 14 |
model.eval()
|
| 15 |
return model
|
| 16 |
|