espnet3.systems.base.inference.infer
espnet3.systems.base.inference.infer
espnet3.systems.base.inference.infer(config: DictConfig)
Run inference over all configured test sets and write SCP files.
This entrypoint expects each inference result to be a dict containing a sample identifier under utt_id (or the configured idx_key), plus one value per output field. The final SCP files are always written under:
${inference_dir}/<test_name>/<field>.scpwhere each line is:
<utt_id> <value_or_path>Primitive values are written directly into SCP files.
Example return value from output_fn or directly from the inference model:
{"utt_id": "utt1", "hyp": "hello world"}Generated SCP:
inference_dir/test-clean/hyp.scp
utt1 hello worldNon-scalar values are serialized through espnet3.utils.writer_utils.write_artifact(). That function documents the detailed rules for JSON, NPY, pickle, WAV, and custom writer cases.
Example WAV configuration:
output_artifacts:
audio:
type: wav
sample_rate: 16000Example return value from output_fn:
{"utt_id": "utt1", "audio": waveform_numpy}Top-level list / tuple outputs are not supported. Each output field must be a single value. If you need structured content, return a dict and let it be serialized as JSON.
- Parameters:config – Hydra/OmegaConf configuration containing the dataset, inference directory, provider/runner definitions, and optional
output_artifactswriter settings.
