espnet3.utils.task_utils.save_espnet_config
Less than 1 minute
espnet3.utils.task_utils.save_espnet_config
espnet3.utils.task_utils.save_espnet_config(task: str, config: Dict | DictConfig, output_dir: str) → None
Save an ESPnet2-compatible training config snapshot to disk.
This builds the full config by merging: : - The task’s default config
- The resolved model config (flattened into root keys)
- Selected dataset preprocessor config (flattened into root keys)
- Any remaining user-provided config keys
- Parameters:
- task (str) – Dotted path to an ESPnet2 Task class.
- config (Union *[*Dict , DictConfig ]) – Training config (OmegaConf or dict).
- output_dir (str) – Output directory where
config.yamlis written.
- Returns: None
- Raises:
- RuntimeError – If the task class cannot be resolved.
- OSError – If the output directory cannot be created or written.
Example
>>> save_espnet_config("espnet2.tasks.asr.ASRTask", cfg, "exp")