Merge pull request #49 from faad3/main

Fix bug in load_voices in audio.py
This commit is contained in:
James Betker 2022-05-17 11:20:44 -06:00 committed by GitHub
commit b5fc8f198b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,14 +119,16 @@ def load_voices(voices):
if latent is None:
assert len(latents) == 0, "Can only combine raw audio voices or latent voices, not both. Do it yourself if you want this."
clips.extend(clip)
elif voice is None:
assert len(voices) == 0, "Can only combine raw audio voices or latent voices, not both. Do it yourself if you want this."
elif clip is None:
assert len(clips) == 0, "Can only combine raw audio voices or latent voices, not both. Do it yourself if you want this."
latents.append(latent)
if len(latents) == 0:
return clips, None
else:
latents = torch.stack(latents, dim=0)
return None, latents.mean(dim=0)
latents_0 = torch.stack([l[0] for l in latents], dim=0).mean(dim=0)
latents_1 = torch.stack([l[1] for l in latents], dim=0).mean(dim=0)
latents = (latents_0,latents_1)
return None, latents
class TacotronSTFT(torch.nn.Module):