espnet3.systems.tts.system.TTSSystem
espnet3.systems.tts.system.TTSSystem
class espnet3.systems.tts.system.TTSSystem(training_config=None, inference_config=None, metrics_config=None, **kwargs)
Bases: BaseSystem
TTS-specific system.
This system adds long-short-utterance removal and token-list creation.
Additional stage-log mappings:
| Stage | Path reference |
|---|---|
remove_long_short | training_config.remove_long_short.save_path |
create_token_list | training_config.create_token_list.save_path |
Initialize the TTS system with TTS-specific stage mappings.
collect_stats(*args, **kwargs)
Run the collect_stats stage using the configured trainer.
Prepares the training runtime (directories, parallelism, seed), then delegates to the trainer’s collect_stats method. Positional and keyword stage arguments are rejected to avoid silent misconfiguration.
This override exists solely so that model.normalize / model.normalize_conf survive into the trainer. It is load-bearing; see the Notes below before replacing it with the inherited stage.
- Parameters:
- *args – Must be empty. Passing any positional argument raises
TypeErrorvia_reject_stage_args. - **kwargs – Must be empty. Passing any keyword argument raises
TypeErrorvia_reject_stage_args.
- *args – Must be empty. Passing any positional argument raises
- Returns: None
- Raises:TypeError – If any positional or keyword arguments are passed.
Notes
Do not delete this override in favour of espnet3.systems.base.training.collect_stats.
The base implementation pops normalize and normalize_conf out of config.model before building the trainer. For a task whose normalizer is optional that is harmless, but for TTS it is not: espnet2.tasks.tts declares normalize_choices with default="global_mvn". Removing the key therefore does not mean “no normalizer” - it restores the global_mvn default.
The F5-TTS recipe configs set normalize: null on purpose, and that null has to reach the task builder intact. If the key is popped, the task builds a GlobalMVN and stats collection dies with:
GlobalMVN.__init__() missing 1 required positional argument:
'stats_file'which is a chicken-and-egg failure: the stats file GlobalMVN wants is exactly the artifact this stage is being run to produce.
Note that the base train() does not pop these keys - only the base collect_stats does. That asymmetry is why train is safely inherited from BaseSystem while collect_stats is not.
##
Example
>>> from omegaconf import OmegaConf
>>> cfg = OmegaConf.create({"exp_dir": "/tmp/exp"})
>>> system = TTSSystem(training_config=cfg)
>>> system.collect_stats() # runs stats collection end-to-endcreate_token_list(*args, **kwargs)
Create token list from training data.
This stage processes the training manifest to extract unique tokens from the text transcriptions and saves them to a token list file.
Under training_config.create_token_list, configure save_path, filename, manifest_path, and token_type. Optional fields are cleaner, g2p, add_symbol, add_nonsplit_symbol, cutoff, vocabulary_size, vocab_builder, and vocab_builder_conf. A custom vocabulary builder replaces the default frequency-count construction.
Example
create_token_list:
save_path: data/token_list
filename: tokens.txt
manifest_path: data/manifest/train.tsv
token_type: phn
cleaner: tacotron
g2p: g2p_en
add_symbol:
- "<blank>:0"
- "<unk>:1"
- "<sos/eos>:-1"- Raises:RuntimeError – If required configuration is missing or manifest file not found.
remove_long_short(*args, **kwargs)
Remove long-short utterances based on duration thresholds.
This stage processes manifest files to filter out utterances that are too short or too long based on specified duration thresholds. It reads WAV headers via soundfile to check audio durations (in parallel, via RemoveLongShortProvider/Runner) and saves filtered manifests for downstream stages.
Under training_config.remove_long_short, configure min_wav_duration, max_wav_duration, save_path, and splits. Optionally configure manifest_paths as a mapping from split to manifest path; it defaults to data/manifest/{split}.tsv.
Example
remove_long_short:
min_wav_duration: 2
max_wav_duration: 30
save_path: data/manifest_filtered
splits: [train, valid, test]- Raises:RuntimeError – If required configuration is missing or manifest files not found.
