Skip phoneme cache pre-compute if the path exists

This commit is contained in:
Eren Gölge
2021-08-09 18:02:36 +00:00
parent 70a4c6f16c
commit d9e18e009b
+6 -2
View File
@@ -1,6 +1,6 @@
import os
from typing import Dict, List, Tuple
import numpy as np
import torch
from coqpit import Coqpit
from torch import nn
@@ -184,7 +184,11 @@ class BaseTTS(BaseModel):
else None,
)
if config.use_phonemes and config.compute_input_seq_cache:
if (
config.use_phonemes
and config.compute_input_seq_cache
and not os.path.exists(dataset.phoneme_cache_path)
):
# precompute phonemes to have a better estimate of sequence lengths.
dataset.compute_input_seq(config.num_loader_workers)
dataset.sort_items()