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 demo UI configuration.
The configuration is expected to define inputs and/or outputs entries, where each entry includes at least:
name: logical field name used to build the model input/output dicttype: component type (e.g.,audio,textbox,dropdown)
- Parameters:ui_cfg – UI configuration (typically
demo_cfg.ui). Can be an OmegaConf object or any object withinputs/outputsattributes. - Returns: A typed spec containing instantiated Gradio components and their corresponding names, plus optional metadata (title/description/article).
- Return type:UiSpec
- Raises:ValueError – If a component entry is missing a non-empty
nameor uses an unsupportedtype.
Example
>>> spec = build_ui_from_config(ui_cfg)
>>> spec.input_names
['speech']Notes
- Component instances are created eagerly; this function does not build a full Gradio app by itself.
