Spaces:
Sleeping
Sleeping
Update requirements and make necessary code changes
Browse files
.ipynb_checkpoints/model_loader-checkpoint.py
CHANGED
|
@@ -634,7 +634,7 @@ def load_model():
|
|
| 634 |
local_file = hf_hub_download(repo_id=checkpoint, filename="cpt.pth")
|
| 635 |
|
| 636 |
# Load the best model state
|
| 637 |
-
state_dict = torch.load(local_file, weights_only=True)
|
| 638 |
model.load_state_dict(state_dict)
|
| 639 |
|
| 640 |
return model, tokenizer
|
|
|
|
| 634 |
local_file = hf_hub_download(repo_id=checkpoint, filename="cpt.pth")
|
| 635 |
|
| 636 |
# Load the best model state
|
| 637 |
+
state_dict = torch.load(local_file, map_location=torch.device('cpu'), weights_only=True)
|
| 638 |
model.load_state_dict(state_dict)
|
| 639 |
|
| 640 |
return model, tokenizer
|
model_loader.py
CHANGED
|
@@ -634,7 +634,7 @@ def load_model():
|
|
| 634 |
local_file = hf_hub_download(repo_id=checkpoint, filename="cpt.pth")
|
| 635 |
|
| 636 |
# Load the best model state
|
| 637 |
-
state_dict = torch.load(local_file, weights_only=True)
|
| 638 |
model.load_state_dict(state_dict)
|
| 639 |
|
| 640 |
return model, tokenizer
|
|
|
|
| 634 |
local_file = hf_hub_download(repo_id=checkpoint, filename="cpt.pth")
|
| 635 |
|
| 636 |
# Load the best model state
|
| 637 |
+
state_dict = torch.load(local_file, map_location=torch.device('cpu'), weights_only=True)
|
| 638 |
model.load_state_dict(state_dict)
|
| 639 |
|
| 640 |
return model, tokenizer
|