mirror of https://github.com/coqui-ai/TTS.git
Fix import
parent
942df0fb05
commit
27b67b7945
|
@ -83,6 +83,8 @@ class TacotronConfig(BaseTTSConfig):
|
|||
ddc_r (int):
|
||||
reduction rate used by the coarse decoder when `double_decoder_consistency` is in use. Set this
|
||||
as a multiple of the `r` value. Defaults to 6.
|
||||
speakers_file (str):
|
||||
Path to the speaker mapping file for the Speaker Manager. Defaults to None.
|
||||
use_speaker_embedding (bool):
|
||||
enable / disable using speaker embeddings for multi-speaker models. If set True, the model is
|
||||
in the multi-speaker mode. Defaults to False.
|
||||
|
@ -176,6 +178,7 @@ class TacotronConfig(BaseTTSConfig):
|
|||
ddc_r: int = 6
|
||||
|
||||
# multi-speaker settings
|
||||
speakers_file: str = None
|
||||
use_speaker_embedding: bool = False
|
||||
speaker_embedding_dim: int = 512
|
||||
use_d_vector_file: bool = False
|
||||
|
|
|
@ -261,7 +261,7 @@ class ForwardTTS(BaseTTS):
|
|||
# init speaker embedding layer
|
||||
if config.use_speaker_embedding and not config.use_d_vector_file:
|
||||
print(" > Init speaker_embedding layer.")
|
||||
self.emb_g = nn.Embedding(self.args.num_speakers, self.args.hidden_channels)
|
||||
self.emb_g = nn.Embedding(self.num_speakers, self.args.hidden_channels)
|
||||
nn.init.uniform_(self.emb_g.weight, -0.1, 0.1)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -44,13 +44,13 @@ class TestTTSDataset(unittest.TestCase):
|
|||
self.max_loader_iter = 4
|
||||
self.ap = AudioProcessor(**c.audio)
|
||||
|
||||
def _create_dataloader(self, batch_size, r, bgs):
|
||||
def _create_dataloader(self, batch_size, r, bgs, start_by_longest=False):
|
||||
|
||||
# load dataset
|
||||
meta_data_train, meta_data_eval = load_tts_samples(dataset_config, eval_split=True, eval_split_size=0.2)
|
||||
items = meta_data_train + meta_data_eval
|
||||
|
||||
tokenizer = TTSTokenizer.init_from_config(c)
|
||||
tokenizer, _ = TTSTokenizer.init_from_config(c)
|
||||
dataset = TTSDataset(
|
||||
outputs_per_step=r,
|
||||
compute_linear_spec=True,
|
||||
|
@ -77,7 +77,7 @@ class TestTTSDataset(unittest.TestCase):
|
|||
|
||||
def test_loader(self):
|
||||
if ok_ljspeech:
|
||||
dataloader, dataset = self._create_dataloader(2, c.r, 0)
|
||||
dataloader, dataset = self._create_dataloader(1, 1, 0)
|
||||
|
||||
for i, data in enumerate(dataloader):
|
||||
if i == self.max_loader_iter:
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.align_tts_config import AlignTTSConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -5,9 +5,9 @@ import shutil
|
|||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.config.shared_configs import BaseAudioConfig
|
||||
from TTS.tts.configs.fast_pitch_config import FastPitchConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
config_path = os.path.join(get_tests_output_path(), "fast_pitch_speaker_emb_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
||||
audio_config = BaseAudioConfig(
|
||||
|
|
|
@ -5,7 +5,7 @@ import shutil
|
|||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.config.shared_configs import BaseAudioConfig
|
||||
from TTS.tts.configs.fast_pitch_config import FastPitchConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.glow_tts_config import GlowTTSConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
@ -17,7 +17,6 @@ config = GlowTTSConfig(
|
|||
num_eval_loader_workers=0,
|
||||
text_cleaner="english_cleaners",
|
||||
use_phonemes=True,
|
||||
use_espeak_phonemes=True,
|
||||
phoneme_language="en-us",
|
||||
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
|
||||
run_eval=True,
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.glow_tts_config import GlowTTSConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
@ -17,7 +17,6 @@ config = GlowTTSConfig(
|
|||
num_eval_loader_workers=0,
|
||||
text_cleaner="english_cleaners",
|
||||
use_phonemes=True,
|
||||
use_espeak_phonemes=True,
|
||||
phoneme_language="en-us",
|
||||
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
|
||||
run_eval=True,
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.glow_tts_config import GlowTTSConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.speedy_speech_config import SpeedySpeechConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_speedy_speech_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.tacotron2_config import Tacotron2Config
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.tacotron2_config import Tacotron2Config
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
@ -28,6 +28,7 @@ config = Tacotron2Config(
|
|||
"Be a voice, not an echo.",
|
||||
],
|
||||
use_speaker_embedding=True,
|
||||
num_speakers=4,
|
||||
max_decoder_steps=50,
|
||||
)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.tacotron2_config import Tacotron2Config
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.tacotron_config import TacotronConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -5,7 +5,7 @@ import shutil
|
|||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.config.shared_configs import BaseDatasetConfig
|
||||
from TTS.tts.configs.vits_config import VitsConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -5,7 +5,7 @@ import shutil
|
|||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.config.shared_configs import BaseDatasetConfig
|
||||
from TTS.tts.configs.vits_config import VitsConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.vits_config import VitsConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
|
||||
from tests import get_device_id, get_tests_output_path, run_cli
|
||||
from TTS.tts.configs.vits_config import VitsConfig
|
||||
from TTS.utils.trainer_utils import get_last_checkpoint
|
||||
from trainer import get_last_checkpoint
|
||||
|
||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||
|
|
Loading…
Reference in New Issue