mirror of https://github.com/coqui-ai/TTS.git
Fix style
This commit is contained in:
parent
72d85e53c9
commit
585e9aa4f0
|
@ -27,6 +27,7 @@ DEF_LANG_TO_PHONEMIZER["en"] = DEF_LANG_TO_PHONEMIZER["en-us"]
|
||||||
DEF_LANG_TO_PHONEMIZER["ja-jp"] = JA_JP_Phonemizer.name()
|
DEF_LANG_TO_PHONEMIZER["ja-jp"] = JA_JP_Phonemizer.name()
|
||||||
DEF_LANG_TO_PHONEMIZER["zh-cn"] = ZH_CN_Phonemizer.name()
|
DEF_LANG_TO_PHONEMIZER["zh-cn"] = ZH_CN_Phonemizer.name()
|
||||||
|
|
||||||
|
|
||||||
def get_phonemizer_by_name(name: str, **kwargs) -> BasePhonemizer:
|
def get_phonemizer_by_name(name: str, **kwargs) -> BasePhonemizer:
|
||||||
"""Initiate a phonemizer by name
|
"""Initiate a phonemizer by name
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,9 @@ class AudioProcessor(object):
|
||||||
self.hop_length = hop_length
|
self.hop_length = hop_length
|
||||||
self.win_length = win_length
|
self.win_length = win_length
|
||||||
assert min_level_db != 0.0, " [!] min_level_db is 0"
|
assert min_level_db != 0.0, " [!] min_level_db is 0"
|
||||||
assert self.win_length <= self.fft_size, f" [!] win_length cannot be larger than fft_size - {self.win_length} vs {self.fft_size}"
|
assert (
|
||||||
|
self.win_length <= self.fft_size
|
||||||
|
), f" [!] win_length cannot be larger than fft_size - {self.win_length} vs {self.fft_size}"
|
||||||
members = vars(self)
|
members = vars(self)
|
||||||
if verbose:
|
if verbose:
|
||||||
print(" > Setting up Audio Processor...")
|
print(" > Setting up Audio Processor...")
|
||||||
|
|
|
@ -3,8 +3,8 @@ import json
|
||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple
|
|
||||||
from shutil import copyfile, rmtree
|
from shutil import copyfile, rmtree
|
||||||
|
from typing import Tuple
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ class ModelManager(object):
|
||||||
output_model_path, output_config_path = self._find_files(output_path)
|
output_model_path, output_config_path = self._find_files(output_path)
|
||||||
return output_model_path, output_config_path, model_item
|
return output_model_path, output_config_path, model_item
|
||||||
|
|
||||||
def _find_files(self, output_path:str) -> Tuple[str, str]:
|
def _find_files(self, output_path: str) -> Tuple[str, str]:
|
||||||
"""Find the model and config files in the output path
|
"""Find the model and config files in the output path
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
@ -49,7 +49,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init model
|
# init model
|
||||||
model = AlignTTS(config, ap, tokenizer)
|
model = AlignTTS(config, ap, tokenizer)
|
||||||
|
|
|
@ -84,7 +84,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init the model
|
# init the model
|
||||||
model = ForwardTTS(config, ap, tokenizer, speaker_manager=None)
|
model = ForwardTTS(config, ap, tokenizer, speaker_manager=None)
|
||||||
|
|
|
@ -83,7 +83,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init the model
|
# init the model
|
||||||
model = ForwardTTS(config, ap, tokenizer)
|
model = ForwardTTS(config, ap, tokenizer)
|
||||||
|
|
|
@ -60,7 +60,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# INITIALIZE THE MODEL
|
# INITIALIZE THE MODEL
|
||||||
# Models take a config object and a speaker manager as input
|
# Models take a config object and a speaker manager as input
|
||||||
|
|
|
@ -67,7 +67,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init model
|
# init model
|
||||||
model = ForwardTTS(config, ap, tokenizer)
|
model = ForwardTTS(config, ap, tokenizer)
|
||||||
|
|
|
@ -77,7 +77,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# INITIALIZE THE MODEL
|
# INITIALIZE THE MODEL
|
||||||
# Models take a config object and a speaker manager as input
|
# Models take a config object and a speaker manager as input
|
||||||
|
|
|
@ -74,7 +74,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# INITIALIZE THE MODEL
|
# INITIALIZE THE MODEL
|
||||||
# Models take a config object and a speaker manager as input
|
# Models take a config object and a speaker manager as input
|
||||||
|
|
|
@ -69,7 +69,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init model
|
# init model
|
||||||
model = Vits(config, ap, tokenizer, speaker_manager=None)
|
model = Vits(config, ap, tokenizer, speaker_manager=None)
|
||||||
|
|
|
@ -109,7 +109,12 @@ config.from_dict(config.to_dict())
|
||||||
ap = AudioProcessor(**config.audio.to_dict())
|
ap = AudioProcessor(**config.audio.to_dict())
|
||||||
|
|
||||||
# load training samples
|
# load training samples
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it maps speaker-id to speaker-name in the model and data-loader
|
# it maps speaker-id to speaker-name in the model and data-loader
|
||||||
|
|
|
@ -71,7 +71,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it maps speaker-id to speaker-name in the model and data-loader
|
# it maps speaker-id to speaker-name in the model and data-loader
|
||||||
|
|
|
@ -69,7 +69,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it maps speaker-id to speaker-name in the model and data-loader
|
# it maps speaker-id to speaker-name in the model and data-loader
|
||||||
|
|
|
@ -69,7 +69,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it maps speaker-id to speaker-name in the model and data-loader
|
# it maps speaker-id to speaker-name in the model and data-loader
|
||||||
|
|
|
@ -69,7 +69,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it maps speaker-id to speaker-name in the model and data-loader
|
# it maps speaker-id to speaker-name in the model and data-loader
|
||||||
|
|
|
@ -72,7 +72,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it mainly handles speaker-id to speaker-name for the model and the data-loader
|
# it mainly handles speaker-id to speaker-name for the model and the data-loader
|
||||||
|
|
|
@ -78,7 +78,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it mainly handles speaker-id to speaker-name for the model and the data-loader
|
# it mainly handles speaker-id to speaker-name for the model and the data-loader
|
||||||
|
|
|
@ -78,7 +78,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it mainly handles speaker-id to speaker-name for the model and the data-loader
|
# it mainly handles speaker-id to speaker-name for the model and the data-loader
|
||||||
|
|
|
@ -79,7 +79,12 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
|
||||||
# You can define your custom sample loader returning the list of samples.
|
# You can define your custom sample loader returning the list of samples.
|
||||||
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
# Or define your custom formatter and pass it to the `load_tts_samples`.
|
||||||
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
# Check `TTS.tts.datasets.load_tts_samples` for more details.
|
||||||
train_samples, eval_samples = load_tts_samples(dataset_config, eval_split=True, eval_split_max_size=config.eval_split_max_size, eval_split_size=config.eval_split_size)
|
train_samples, eval_samples = load_tts_samples(
|
||||||
|
dataset_config,
|
||||||
|
eval_split=True,
|
||||||
|
eval_split_max_size=config.eval_split_max_size,
|
||||||
|
eval_split_size=config.eval_split_size,
|
||||||
|
)
|
||||||
|
|
||||||
# init speaker manager for multi-speaker training
|
# init speaker manager for multi-speaker training
|
||||||
# it maps speaker-id to speaker-name in the model and data-loader
|
# it maps speaker-id to speaker-name in the model and data-loader
|
||||||
|
|
Loading…
Reference in New Issue