espnet3.systems.f5tts.src.remove_long_short.RemoveLongShortProvider
espnet3.systems.f5tts.src.remove_long_short.RemoveLongShortProvider
class espnet3.systems.f5tts.src.remove_long_short.RemoveLongShortProvider(config: DictConfig, params: Dict[str, Any] | None = None)
Bases: EnvironmentProvider
Provider for the remove_long_short stage.
Builds the manifest entries and duration bounds shared by RemoveLongShortRunner workers. No model is loaded: duration filtering only reads audio headers.
Store the stage parameters handed to every worker.
- Parameters:
- config – Training config. Kept for the
EnvironmentProvidercontract; the stage settings travel inparams. - params –
manifest_path,min_durationandmax_duration, forwarded from the driver to every worker.
- config – Training config. Kept for the
Example
>>> provider = RemoveLongShortProvider(
... config=training_config,
... params={
... "manifest_path": "data/manifest/train.tsv",
... "min_duration": 1.0,
... "max_duration": 20.0,
... },
... )NOTE
Nothing is read or checked here. The manifest is parsed, and a missing parameter reported, when the environment is built.
build_env_local() → Dict[str, Any]
Build the environment once on the driver for local execution.
- Returns: Dict with
entries,min_duration,max_durationandnum_dropped_empty, whichRemoveLongShortRunner.forward()receives as keyword arguments. - Raises:RuntimeError – If
manifest_pathor a duration bound is missing fromparams.
Example
>>> env = provider.build_env_local()
>>> sorted(env)
['entries', 'max_duration', 'min_duration', 'num_dropped_empty']
>>> len(env["entries"]), env["num_dropped_empty"]
(2, 1)build_worker_setup_fn() → Callable[[], Dict[str, Any]]
Create the worker setup function for distributed execution.
- Returns: A zero-argument callable, run once per worker, that returns the same environment as
build_env_local().
Example
>>> setup_fn = provider.build_worker_setup_fn()
>>> setup_fn() == provider.build_env_local()
TrueNOTE
The callable closes over params only, never over the provider, so it can be pickled and sent to a Dask worker.
