From 588848d30fa4e3fc669ced81d780517145be3e2e Mon Sep 17 00:00:00 2001 From: zhzluke96 Date: Mon, 3 Jun 2024 22:22:57 +0800 Subject: [PATCH] :bug: speaker load --- modules/speaker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/speaker.py b/modules/speaker.py index e621669..7461a23 100644 --- a/modules/speaker.py +++ b/modules/speaker.py @@ -42,12 +42,13 @@ def __init__(self): self.refresh_speakers() def refresh_speakers(self): - device = torch.device("cuda" if torch.cuda.is_available() else "cpu") self.speakers = [] for speaker in os.listdir(self.speaker_dir): if speaker.endswith(".pt"): self.speakers.append( - torch.load(self.speaker_dir + speaker, map_location=device) + torch.load( + self.speaker_dir + speaker, map_location=torch.device("cpu") + ) ) def list_speakers(self):