espnet3.demo.ui.build_ui_from_config
Less than 1 minute
espnet3.demo.ui.build_ui_from_config
espnet3.demo.ui.build_ui_from_config(ui_cfg) → UiSpec
Build a UiSpec from a demo UI configuration object.
The input config is expected to provide: : - inputs: list of component configs (each with at least name and type)
outputs: list of component configs- Optional UI metadata such as
title/description/article.
- Parameters:ui_cfg – UI configuration (OmegaConf config, dict-like, or attribute object).
- Returns: A typed UI spec containing instantiated Gradio components and : aligned input/output name lists.
- Return type:UiSpec
- Raises:ValueError – If a component is missing a non-empty
nameor has an unsupportedtype.
Example
>>> from omegaconf import OmegaConf
>>> ui_cfg = OmegaConf.create(
... {
... "inputs": [{"name": "speech", "type": "audio"}],
... "outputs": [{"name": "text", "type": "textbox"}],
... }
... )
>>> spec = build_ui_from_config(ui_cfg)
>>> spec.input_names
['speech']