espnet3.systems.launch.launch
espnet3.systems.launch.launch
espnet3.systems.launch.launch(system_cls: type, , conf_package: str | None = None, argv: Sequence[str] | None = None, parser: ArgumentParser | None = None) → None
Parse CLI args, build system_cls, and run its requested stages.
Loads each config role’s own config (the default plus whatever the caller gave, not yet resolved), passes them to system_cls to build each requested stage’s merged, resolved config (see BaseSystem), then runs the requested stages, baking each stage’s own config before it runs.
- Parameters:
- system_cls – The system class to instantiate and run.
- conf_package – Package holding the default configs; defaults to
default_conf_package(). - argv – Arguments to parse instead of
sys.argv. - parser – A parser to use instead of
build_parser(system_cls), for a recipe that needs its own extra arguments.
- Raises:
- espnet3.contract.stages.StageContractError – A requested stage is not declared, or its config role was not given and no
--exp_diris given to inherit it from an earlier run. - RuntimeError – No
--exp_diris given and no role’s own config has a self-resolvingexp_dir.
- espnet3.contract.stages.StageContractError – A requested stage is not declared, or its config role was not given and no
Examples
```python
egs3/mini_an4/esp2_asr/run.py
from espnet3.systems.esp2_asr.system import ASRSystem from espnet3.systems.launch import launch
if __name__ == “_main_”: : launch(ASRSystem)
```The __main__ guard is required: collect_stats/train spawn Dask/DataLoader worker processes that re-import run.py; without the guard, each worker re-runs launch(...) itself.
