Spaces:
Build error
Build error
oops
Browse files- src/utils.py +2 -2
src/utils.py
CHANGED
|
@@ -297,14 +297,14 @@ def generate(
|
|
| 297 |
latents_path = f'{get_voice_dir()}/{voice}/cond_latents.pth'
|
| 298 |
|
| 299 |
if voice == "random" or voice == "microphone":
|
| 300 |
-
if latents and settings['conditioning_latents']:
|
| 301 |
dir = f'{get_voice_dir()}/{voice}/'
|
| 302 |
if not os.path.isdir(dir):
|
| 303 |
os.makedirs(dir, exist_ok=True)
|
| 304 |
latents_path = f'{dir}/cond_latents.pth'
|
| 305 |
torch.save(conditioning_latents, latents_path)
|
| 306 |
else:
|
| 307 |
-
if settings and "model_hash" in settings:
|
| 308 |
latents_path = f'{get_voice_dir()}/{voice}/cond_latents_{settings["model_hash"][:8]}.pth'
|
| 309 |
else:
|
| 310 |
latents_path = f'{get_voice_dir()}/{voice}/cond_latents_{tts.autoregressive_model_hash[:8]}.pth'
|
|
|
|
| 297 |
latents_path = f'{get_voice_dir()}/{voice}/cond_latents.pth'
|
| 298 |
|
| 299 |
if voice == "random" or voice == "microphone":
|
| 300 |
+
if latents and settings is not None and settings['conditioning_latents']:
|
| 301 |
dir = f'{get_voice_dir()}/{voice}/'
|
| 302 |
if not os.path.isdir(dir):
|
| 303 |
os.makedirs(dir, exist_ok=True)
|
| 304 |
latents_path = f'{dir}/cond_latents.pth'
|
| 305 |
torch.save(conditioning_latents, latents_path)
|
| 306 |
else:
|
| 307 |
+
if settings is not None and "model_hash" in settings:
|
| 308 |
latents_path = f'{get_voice_dir()}/{voice}/cond_latents_{settings["model_hash"][:8]}.pth'
|
| 309 |
else:
|
| 310 |
latents_path = f'{get_voice_dir()}/{voice}/cond_latents_{tts.autoregressive_model_hash[:8]}.pth'
|