espnet3.demo.app_builder.build_demo_app
Less than 1 minute
espnet3.demo.app_builder.build_demo_app
espnet3.demo.app_builder.build_demo_app(demo_dir: Path) → Blocks
Build a Gradio demo app from a demo directory.
This loads demo.yaml from demo_dir, builds an inference runtime, and constructs a Gradio UI based on the config (or system defaults).
- Parameters:demo_dir (Path) – Directory containing
demo.yaml(and optional assets). - Returns: A configured Gradio
Blocksapp instance. - Return type: gr.Blocks
- Raises:
- FileNotFoundError – If
demo.yamlcannot be found underdemo_dir. - ValueError – If UI config is missing and no system defaults are available.
- FileNotFoundError – If
Example
>>> import gradio as gr
>>> from pathlib import Path
>>> app = build_demo_app(Path("exp/demo"))
>>> isinstance(app, gr.Blocks)
True
>>> # app.launch() # run the UI