Merge pull request #17 from jorisSchaller/non-CUDA

Allow non-CUDA device to be used
This commit is contained in:
Zengyi Qin 2024-01-01 23:06:26 -05:00 committed by GitHub
commit 44039f77d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
api.py
View File

@ -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)