espnet3.systems.launch.launch
Less than 1 minute
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.
- 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.
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.
