MuGeminorum commited on
Commit
cadcfd6
1 Parent(s): 718237e
Files changed (1) hide show
  1. model.py +6 -1
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(torch.load(path_to_checkpoint_file))
 
 
 
 
 
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