Skip to content

Commit

Permalink
Merge pull request IAHispano#751 from ShiromiyaG/oops
Browse files Browse the repository at this point in the history
Fix speaker ID when it doesn't exist in the file
  • Loading branch information
blaisewf authored Sep 28, 2024
2 parents eeea1be + 01d73ba commit c67d0a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tabs/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ def get_speakers_id(model):
if model:
model_data = torch.load(model, map_location="cpu")
speakers_id = model_data.get("speakers_id", 0)
return list(range(speakers_id))
if speakers_id:
return list(range(speakers_id))
else:
return [0]


# Inference tab
Expand Down
5 changes: 4 additions & 1 deletion tabs/tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ def get_speakers_id(model):
if model:
model_data = torch.load(model, map_location="cpu")
speakers_id = model_data.get("speakers_id", 0)
return list(range(speakers_id))
if speakers_id:
return list(range(speakers_id))
else:
return [0]


# TTS tab
Expand Down

0 comments on commit c67d0a3

Please sign in to comment.