espnet3.demo.runtime.build_runtime
Less than 1 minute
espnet3.demo.runtime.build_runtime
espnet3.demo.runtime.build_runtime(demo_cfg, demo_dir: Path) → DemoRuntime
Build a demo runtime (model + runner + UI mapping) from demo config.
This resolves the inference provider/runner classes from demo_cfg, loads the inference config (if provided), and instantiates the model via the provider.
- Parameters:
- demo_cfg – Demo configuration (typically loaded from
demo.yaml). - demo_dir (Path) – Demo directory used to resolve relative config paths.
- demo_cfg – Demo configuration (typically loaded from
- Returns: Runtime container with model, runner class, output key mapping, and extra kwargs for inference.
- Return type:DemoRuntime
- Raises:RuntimeError – If no inference provider is configured, or an inference config is required to build the model but missing.
Example
>>> from pathlib import Path
>>> runtime = build_runtime(demo_cfg, Path("./demo"))
>>> runtime.model is not None
True