From 68f4858ce92e8de9def46e8cec77a714375587e0 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 3 Mar 2023 05:51:17 +0000 Subject: [PATCH] oops --- src/utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils.py b/src/utils.py index 215fc7c..39e11d2 100755 --- a/src/utils.py +++ b/src/utils.py @@ -378,8 +378,16 @@ def generate( if voice and voice != "random" and conditioning_latents is not None: - with open(f'{get_voice_dir()}/{voice}/cond_latents.pth', 'rb') as f: - info['latents'] = base64.b64encode(f.read()).decode("ascii") + latents_path = f'{get_voice_dir()}/{voice}/cond_latents.pth' + + if hasattr(tts, 'autoregressive_model_hash'): + latents_path = f'{get_voice_dir()}/{voice}/cond_latents_{tts.autoregressive_model_hash[:8]}.pth' + + try: + with open(latents_path, 'rb') as f: + info['latents'] = base64.b64encode(f.read()).decode("ascii") + except Exception as e: + pass if args.embed_output_metadata: for name in progress.tqdm(audio_cache, desc="Embedding metadata..."):