espnet3.publication.demo.packing.pack_demo
Less than 1 minute
espnet3.publication.demo.packing.pack_demo
espnet3.publication.demo.packing.pack_demo(system) → Path
Package a demo into a self-contained directory ready for upload.
Reads system.demo_config and produces a directory that contains:
demo.yaml: the resolved demo config with all paths rewritten to be relative to the output directory so the pack is portable.app.py: the Gradio launcher script specified bydemo_config.ui.app_script.- Any extra files listed in
demo_config.pack.include. - Optionally a description file referenced by
demo_config.ui.description.
The output directory is determined in order of priority:
demo_config.pack.out_dir(explicit)system.exp_dir / "demo"Path.cwd() / "demo"
- Parameters:system – An ESPnet3 system instance with
demo_configset. - Returns: Path to the packed demo directory.
- Raises:
- RuntimeError – If
system.demo_configisNone. - ValueError – If
demo_config.model.dir_or_tagcannot be inferred.
- RuntimeError – If
Examples
>>> demo_dir = pack_demo(system)
>>> print(demo_dir)
/path/to/exp/demo