espnet3.systems.f5tts.system.F5TTSSystem
espnet3.systems.f5tts.system.F5TTSSystem
class espnet3.systems.f5tts.system.F5TTSSystem(, configs: Mapping[str, DictConfig | None], exp_dir: Path | None = None, stages_to_run: Sequence[str] | None = None)
Bases: BaseSystem
System for recipes that train espnet3.systems.f5tts.src.f5tts.F5TTS.
The stage order of an F5-TTS recipe is create_dataset -> remove_long_short -> create_token_list -> collect_stats -> train -> infer -> measure -> pack_model -> upload_model -> pack_demo -> upload_demo. Every stage other than the two added here is inherited from BaseSystem unchanged: the model is instantiated directly from the train stage config’s model._target_, with task left unset.
######### Examples
>>> [s.name for s in F5TTSSystem.stages[:3]]
['create_dataset', 'remove_long_short', 'create_token_list']Build each requested stage’s config and hold it, by stage name.
- Parameters:
- configs – Each config role’s own config (its default plus whatever the caller loaded), not yet resolved, keyed by role name (
"training","inference", …). A role this system has no stage for is ignored; a role it does have a stage for but that is missing here is treated as empty. A stage that needs its ownrecipe_dirreads it from its own config (self.stage_configs[stage].recipe_dir), not from a separate constructor argument. - exp_dir – The experiment directory to bake stage configs under and read earlier baked configs from. When None, derived from the first given config whose own exp_dir resolves by itself (see _exp_dir_from); if none does, raises.
- stages_to_run – The stages this run actually requests. Only these (and the earlier stages they inherit from) have their config built and resolved; a later stage’s missing identity never stops construction. None builds every declared stage.
- configs – Each config role’s own config (its default plus whatever the caller loaded), not yet resolved, keyed by role name (
- Raises:ConfigError – exp_dir is not given and no config in configs has a self-resolving exp_dir.
Notes
Each stage’s config is its own DictConfig object - the earlier stages’ own keys (this run’s, in memory, or an earlier run’s baked file), then this stage’s own config on top, then resolved. No two stages share one config object, so one stage popping or overwriting a key never affects another.
create_token_list(*args, **kwargs)
Build the token list from the training manifest.
Runs the create_token_list stage on its own stage config. See espnet3.systems.f5tts.src.create_token_list.create_token_list() for the create_token_list fields and the file written.
- Raises:
- TypeError – If any positional or keyword argument is passed.
- RuntimeError – If required configuration is missing or the manifest file is not found.
######### Examples
>>> system = F5TTSSystem(configs={"training": training_config})
>>> system.create_token_list()NOTE
The model and the dataset preprocessor both read the token list this stage writes, so it has to run before collect_stats.
remove_long_short(*args, **kwargs)
Filter the recipe’s manifests by audio duration.
Runs the remove_long_short stage on its own stage config. See espnet3.systems.f5tts.src.remove_long_short.remove_long_short() for the remove_long_short fields and the files written.
- Raises:
- TypeError – If any positional or keyword argument is passed.
- RuntimeError – If required configuration is missing or a manifest file is not found.
######### Examples
>>> system = F5TTSSystem(configs={"training": training_config})
>>> system.remove_long_short()NOTE
Run it after create_dataset, which writes the manifests it reads, and before create_token_list, which reads the filtered training manifest.
stages : ClassVar[tuple[StageSpec, ...]] = (StageSpec(name='create_dataset', config='training', log_dir='data_dir', dir_aliases=()), StageSpec(name='remove_long_short', config='training', log_dir='remove_long_short.save_path', dir_aliases=()), StageSpec(name='create_token_list', config='training', log_dir='create_token_list.save_path', dir_aliases=()), StageSpec(name='collect_stats', config='training', log_dir='stats_dir', dir_aliases=()), StageSpec(name='train', config='training', log_dir='exp_dir', dir_aliases=()), StageSpec(name='infer', config='inference', log_dir='inference_dir', dir_aliases=()), StageSpec(name='measure', config='metrics', log_dir='inference_dir', dir_aliases=()), StageSpec(name='pack_model', config=('training', 'publication'), log_dir=None, dir_aliases=()), StageSpec(name='upload_model', config='publication', log_dir=None, dir_aliases=()), StageSpec(name='pack_demo', config='demo', log_dir='pack.out_dir', dir_aliases=()), StageSpec(name='upload_demo', config='demo', log_dir='pack.out_dir', dir_aliases=()))
