From 8d6180fcb3e350e64d9daf3e3777cb0a49270d01 Mon Sep 17 00:00:00 2001 From: jorisSchaller Date: Mon, 1 Jan 2024 20:14:33 +0100 Subject: [PATCH] Allow non-CUDA device to be used --- api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.py b/api.py index b769470..41c6294 100644 --- a/api.py +++ b/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)