espnet3.demo.pack.pack_demo
Less than 1 minute
espnet3.demo.pack.pack_demo
espnet3.demo.pack.pack_demo(system) → Path
Package demo assets and configs into a runnable demo directory.
This stage prepares a self-contained directory suitable for launching a Gradio demo (e.g., on Hugging Face Spaces). It writes:
demo.yaml(resolved and rewritten for the packaged directory)config/infer.yaml(resolved inference config)app.pyandrequirements.txt(viasetup_demo_assets())- Optional extra files configured in
demo.yaml.
- Parameters:system – System instance that exposes
demo_configand related paths. - Returns: The created demo directory.
- Return type: Path
- Raises:
- RuntimeError – If the system has no
demo_configor required fields. - ValueError – If an inference provider cannot be resolved or configs are missing.
- RuntimeError – If the system has no
Example
>>> demo_dir = pack_demo(system)
>>> (demo_dir / "app.py").exists()
True