Spaces:
Sleeping
Sleeping
Update model.py
Browse files
model.py
CHANGED
|
@@ -21,4 +21,4 @@ class Model(torch.nn.Module):
|
|
| 21 |
torch.save(self.state_dict(), path)
|
| 22 |
|
| 23 |
def load(self, path):
|
| 24 |
-
self.load_state_dict(torch.load(path, weights_only=True))
|
|
|
|
| 21 |
torch.save(self.state_dict(), path)
|
| 22 |
|
| 23 |
def load(self, path):
|
| 24 |
+
self.load_state_dict(torch.load(path, weights_only=True, map_location=torch.device('cpu')))
|