ESPnet3 Demo
About 1 min
ESPnet3 Demo
This section documents the developer-facing demo subsystem used by pack_demo and upload_demo.
Important
The current demo implementation lives under espnet3/publication/demo.
What a demo is
An ESPnet3 demo is a packed inference app built from:
demo.yaml- a packed model directory or remote model tag
- a recipe-local Gradio launcher such as
egs3/TEMPLATE/asr/src/app.py - optional extra files copied into the bundle
Demo config
demo.yaml tells pack_demo where to load the model from, which app.py to copy, and which Gradio inputs and outputs to expose.
demo.yamleditable
Gradio previewlive
Gradio Demo
Input speech
Drop audio or record
Transcription
Output will appear here
Built-in types: only
audio and text are registered by default in UIAssetRegistry. Any other value in type: will cause a KeyError at runtime — unless you register a custom UIAsset in your app.py first. Keep the config small at first:
| Key | Purpose |
|---|---|
model.dir_or_tag | Local packed model directory or remote pretrained tag |
model.trust_user_code | Allow bundled recipe code when the model requires it |
ui.app_script | Recipe-local Gradio launcher copied into the demo bundle |
ui.inputs | Gradio input components mapped to model input keys |
ui.outputs | Gradio output components mapped from model output keys |
upload_demo.hf_repo | Hugging Face Space or repository used by upload |
The built-in UI registry currently supports audio and text. Register a custom UI asset in app.py before using another type.
Main runtime idea
The demo runtime does not build provider or runner objects directly. It loads an InferenceModel, maps Gradio inputs to model inputs, and maps model outputs back to Gradio outputs.
Main modules
| Module | Role |
|---|---|
espnet3/publication/demo/packing.py | Pack and upload demo directories |
espnet3/publication/demo/session.py | Load demo config, model, and UI specs into a runtime session |
espnet3/publication/demo/assets.py | Built-in UI asset registry and Gradio component builders |
espnet3/publication/inference_model.py | Packed-model inference runtime used by demos |
egs3/TEMPLATE/asr/src/app.py | Default recipe-local Gradio launcher |
Typical flow
pack_demoresolves and rewritesdemo.yamlpack_democopiesapp.py, description files, andpack.includeassets- a packed demo is launched with
python app.py app.pyloads aDemoSession- the session loads
InferenceModel - UI inputs are mapped to model inputs
- model outputs are mapped back to UI outputs
