Skip to content

Commit

Permalink
🐛 speaker load
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed Jun 3, 2024
1 parent 3f63aa7 commit 588848d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 588848d

Please sign in to comment.