espnet3.demo.runtime.run_inference
Less than 1 minute
espnet3.demo.runtime.run_inference
espnet3.demo.runtime.run_inference(runtime: DemoRuntime, , ui_names: List[str], ui_values: List[Any], output_names: List[str]) → List[Any]
Run a single inference pass and map outputs for the UI.
This helper builds a one-item dataset from the UI inputs and then calls the configured runner (or the model directly if no runner is configured).
- Parameters:
- runtime (DemoRuntime) – Demo runtime built by
build_runtime(). - ui_names (List *[*str ]) – UI input names (component names).
- ui_values (List *[*Any ]) – UI input values (aligned with
ui_names). - output_names (List *[*str ]) – UI output names to return values for.
- runtime (DemoRuntime) – Demo runtime built by
- Returns: Output values aligned with
output_names. - Return type: List[Any]
- Raises:
- ValueError – If output mapping is missing/mismatched for multi-output UIs.
- RuntimeError – If no runner is configured and the model is not callable.
Example
>>> run_inference(
... runtime,
... ui_names=["speech"],
... ui_values=["sample.wav"],
... output_names=["text"],
... )