Spaces:
Running
Running
MuGeminorum
commited on
Commit
•
cadcfd6
1
Parent(s):
718237e
fix cpu
Browse files
model.py
CHANGED
@@ -173,6 +173,11 @@ class Model(torch.jit.ScriptModule):
|
|
173 |
return path_to_checkpoint_file
|
174 |
|
175 |
def restore(self, path_to_checkpoint_file):
|
176 |
-
self.load_state_dict(
|
|
|
|
|
|
|
|
|
|
|
177 |
step = int(path_to_checkpoint_file.split('\\')[-1][6:-4])
|
178 |
return step
|
|
|
173 |
return path_to_checkpoint_file
|
174 |
|
175 |
def restore(self, path_to_checkpoint_file):
|
176 |
+
self.load_state_dict(
|
177 |
+
torch.load(
|
178 |
+
path_to_checkpoint_file,
|
179 |
+
map_location=torch.device('cpu')
|
180 |
+
)
|
181 |
+
)
|
182 |
step = int(path_to_checkpoint_file.split('\\')[-1][6:-4])
|
183 |
return step
|