Mike Gabriel commited on
Commit ·
4e9451d
1
Parent(s): 2a3cf64
Update to work on mac
Browse files- .python-version +1 -0
- main.py +1 -1
.python-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3.10
|
main.py
CHANGED
|
@@ -64,7 +64,7 @@ def run_model(model: nn.Module, response_size: int = BLOCK_SIZE):
|
|
| 64 |
|
| 65 |
if os.path.exists('model.pth'):
|
| 66 |
print("Loading model from file...")
|
| 67 |
-
checkpoint = torch.load('model.pth')
|
| 68 |
m.load_state_dict(checkpoint['model_state_dict'])
|
| 69 |
print("Model loaded!")
|
| 70 |
else:
|
|
|
|
| 64 |
|
| 65 |
if os.path.exists('model.pth'):
|
| 66 |
print("Loading model from file...")
|
| 67 |
+
checkpoint = torch.load('model.pth', map_location=DEVICE)
|
| 68 |
m.load_state_dict(checkpoint['model_state_dict'])
|
| 69 |
print("Model loaded!")
|
| 70 |
else:
|