kevinwang676 commited on
Commit
7a2bce5
1 Parent(s): 358d9fc

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +1 -1
api.py CHANGED
@@ -34,7 +34,7 @@ class OpenVoiceBaseClass(object):
34
  self.device = device
35
 
36
  def load_ckpt(self, ckpt_path):
37
- checkpoint_dict = torch.load(ckpt_path)
38
  a, b = self.model.load_state_dict(checkpoint_dict['model'], strict=False)
39
  print("Loaded checkpoint '{}'".format(ckpt_path))
40
  print('missing/unexpected keys:', a, b)
 
34
  self.device = device
35
 
36
  def load_ckpt(self, ckpt_path):
37
+ checkpoint_dict = torch.load(ckpt_path, map_location=torch.device('cpu'))
38
  a, b = self.model.load_state_dict(checkpoint_dict['model'], strict=False)
39
  print("Loaded checkpoint '{}'".format(ckpt_path))
40
  print('missing/unexpected keys:', a, b)