forked from mrq/ai-voice-cloning
Fix random voice in utils.py
This commit is contained in:
parent
7b8cf348c8
commit
7274899d88
13
src/utils.py
13
src/utils.py
|
@ -1182,11 +1182,14 @@ def generate_tortoise(**kwargs):
|
||||||
latents_path = f'{dir}/cond_latents_{model_hash}.pth'
|
latents_path = f'{dir}/cond_latents_{model_hash}.pth'
|
||||||
|
|
||||||
if voice == "random" or voice == "microphone":
|
if voice == "random" or voice == "microphone":
|
||||||
# if latents and settings is not None and settings['conditioning_latents']:
|
if args.use_hifigan:
|
||||||
if latents and settings is not None and torch.any(settings['conditioning_latents']):
|
if latents and settings is not None and torch.any(settings['conditioning_latents']):
|
||||||
|
os.makedirs(dir, exist_ok=True)
|
||||||
os.makedirs(dir, exist_ok=True)
|
torch.save(conditioning_latents, latents_path)
|
||||||
torch.save(conditioning_latents, latents_path)
|
else:
|
||||||
|
if latents and settings is not None and settings['conditioning_latents']:
|
||||||
|
os.makedirs(dir, exist_ok=True)
|
||||||
|
torch.save(conditioning_latents, latents_path)
|
||||||
|
|
||||||
if latents_path and os.path.exists(latents_path):
|
if latents_path and os.path.exists(latents_path):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user