mirror of
https://github.com/myshell-ai/OpenVoice
synced 2024-11-22 23:19:15 +00:00
Merge pull request #17 from jorisSchaller/non-CUDA
Allow non-CUDA device to be used
This commit is contained in:
commit
44039f77d4
2
api.py
2
api.py
@ -33,7 +33,7 @@ class OpenVoiceBaseClass(object):
|
||||
self.device = device
|
||||
|
||||
def load_ckpt(self, ckpt_path):
|
||||
checkpoint_dict = torch.load(ckpt_path)
|
||||
checkpoint_dict = torch.load(ckpt_path, map_location=torch.device(self.device))
|
||||
a, b = self.model.load_state_dict(checkpoint_dict['model'], strict=False)
|
||||
print("Loaded checkpoint '{}'".format(ckpt_path))
|
||||
print('missing/unexpected keys:', a, b)
|
||||
|
Loading…
Reference in New Issue
Block a user