Spaces:
Runtime error
Runtime error
kevinwang676
commited on
Commit
•
7a2bce5
1
Parent(s):
358d9fc
Update api.py
Browse files
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)
|