espnet3.systems.launch.build_parser
Less than 1 minute
espnet3.systems.launch.build_parser
espnet3.systems.launch.build_parser(system_cls: type) → ArgumentParser
Build stage, config-role and directory CLI flags for system_cls.
- Parameters:system_cls – The system class whose declared stages set the
--stageschoices. - Returns: A parser with
--stages, one--<role>_configperlist_roles()ofsystem_cls,--exp_dir,--dry_run,--write_requirements, and per-stage directory flags derived from each stage’slog_dirkey.
Examples
>>> from espnet3.systems.esp2_asr.system import ASRSystem
>>> parser = build_parser(ASRSystem)
>>> args = parser.parse_args(["--stages", "train"])
>>> args.stages
['train']