espnet3.utils.task_utils.get_espnet_model
Less than 1 minute
espnet3.utils.task_utils.get_espnet_model
espnet3.utils.task_utils.get_espnet_model(task: str, config: Dict | DictConfig | None) → AbsESPnetModel
Build and return an ESPnet model from the given task and config.
- Parameters:
- task – ESPnet-2 task path (e.g. “espnet2.tasks.asr.ASRTask”).
- config – Model config overrides. Must be a non-empty mapping; a task cannot build a model from no configuration at all.
- Returns: The constructed ESPnet-2 model.
- Raises:ValueError – config is None or empty.
Examples
>>> get_espnet_model("espnet2.tasks.asr.ASRTask", None)
Traceback (most recent call last):
ValueError: task='espnet2.tasks.asr.ASRTask' requires a non-empty ...