mirror of https://github.com/coqui-ai/TTS.git
Merge pull request #1047 from coqui-ai/fix_lang_assign
Fix language assignment
This commit is contained in:
commit
b0d6883917
|
@ -193,9 +193,12 @@ class BaseDatasetConfig(Coqpit):
|
||||||
Name of the dataset meta file. Or a list of speakers to be ignored at training for multi-speaker datasets.
|
Name of the dataset meta file. Or a list of speakers to be ignored at training for multi-speaker datasets.
|
||||||
Defaults to None.
|
Defaults to None.
|
||||||
|
|
||||||
unused_speakers (List):
|
ignored_speakers (List):
|
||||||
List of speakers IDs that are not used at the training. Default None.
|
List of speakers IDs that are not used at the training. Default None.
|
||||||
|
|
||||||
|
language (str):
|
||||||
|
Language code of the dataset. If defined, it overrides `phoneme_language`. Defaults to None.
|
||||||
|
|
||||||
meta_file_val (str):
|
meta_file_val (str):
|
||||||
Name of the dataset meta file that defines the instances used at validation.
|
Name of the dataset meta file that defines the instances used at validation.
|
||||||
|
|
||||||
|
|
|
@ -273,9 +273,9 @@ class TTSDataset(Dataset):
|
||||||
item = args[0]
|
item = args[0]
|
||||||
func_args = args[1]
|
func_args = args[1]
|
||||||
text, wav_file, *_ = item
|
text, wav_file, *_ = item
|
||||||
if item[3] is not None and item[3] != '':
|
func_args[3] = (
|
||||||
# If language is specified in dataset, overwrite phoneme_language key
|
item[3] if item[3] else func_args[3]
|
||||||
func_args[3] = item[3]
|
) # override phoneme language if specified by the dataset formatter
|
||||||
phonemes = TTSDataset._load_or_generate_phoneme_sequence(wav_file, text, *func_args)
|
phonemes = TTSDataset._load_or_generate_phoneme_sequence(wav_file, text, *func_args)
|
||||||
return phonemes
|
return phonemes
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@ from TTS.tts.utils.speakers import SpeakerManager
|
||||||
from TTS.utils.audio import AudioProcessor
|
from TTS.utils.audio import AudioProcessor
|
||||||
|
|
||||||
output_path = os.path.dirname(os.path.abspath(__file__))
|
output_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
dataset_config = BaseDatasetConfig(name="vctk", meta_file_train="", path=os.path.join(output_path, "../VCTK/"))
|
dataset_config = BaseDatasetConfig(
|
||||||
|
name="vctk", meta_file_train="", language="en-us", path=os.path.join(output_path, "../VCTK/")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
audio_config = BaseAudioConfig(
|
audio_config = BaseAudioConfig(
|
||||||
|
@ -49,7 +51,6 @@ config = VitsConfig(
|
||||||
epochs=1000,
|
epochs=1000,
|
||||||
text_cleaner="english_cleaners",
|
text_cleaner="english_cleaners",
|
||||||
use_phonemes=True,
|
use_phonemes=True,
|
||||||
phoneme_language="en-us",
|
|
||||||
phoneme_cache_path=os.path.join(output_path, "phoneme_cache"),
|
phoneme_cache_path=os.path.join(output_path, "phoneme_cache"),
|
||||||
compute_input_seq_cache=True,
|
compute_input_seq_cache=True,
|
||||||
print_step=25,
|
print_step=25,
|
||||||
|
|
Loading…
Reference in New Issue