From 7274899d885ccd98d386835615c7c51eb5e12a63 Mon Sep 17 00:00:00 2001 From: Jarod Mica Date: Sun, 26 Nov 2023 22:52:22 -0800 Subject: [PATCH] Fix random voice in utils.py --- src/utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils.py b/src/utils.py index eb4e122..a0f0588 100755 --- a/src/utils.py +++ b/src/utils.py @@ -1182,11 +1182,14 @@ def generate_tortoise(**kwargs): latents_path = f'{dir}/cond_latents_{model_hash}.pth' if voice == "random" or voice == "microphone": - # if latents and settings is not None and settings['conditioning_latents']: - if latents and settings is not None and torch.any(settings['conditioning_latents']): - - os.makedirs(dir, exist_ok=True) - torch.save(conditioning_latents, latents_path) + if args.use_hifigan: + if latents and settings is not None and torch.any(settings['conditioning_latents']): + os.makedirs(dir, exist_ok=True) + 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): try: