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. When espnet3.systems.base.inference_runner.InferenceRunner is used, workers first write shard-local files under:
${inference_dir}/<test_name>/split.<rank>/Example result after the runner attaches its sample identifier:
{"utt_id": "utt1", "hyp": "hello world"}Generated SCP:
inference_dir/test-clean/hyp.scp
utt1 hello worldNon-scalar values are serialized per shard, for example:
${inference_dir}/<test_name>/split.<rank>/<field>/<utt_id>.*and the final merged <field>.scp written under ${inference_dir}/<test_name>/ points at those shard-local paths.
Example WAV configuration:
output_artifacts:
audio:
type: wav
sample_rate: 16000Example audio result:
{"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.
input_key selects the dataset columns passed to the native backend. An inference contract validates and normalizes inputs and named backend outputs. The runner attaches the sample identifier. Legacy configs can still use output_fn. A reference for scoring is read from the dataset (bind ref to dataset:text in the metrics config’s inputs:).
- Parameters:config – Hydra/OmegaConf configuration containing the dataset, inference directory, provider/runner definitions, and optional
output_artifactswriter settings. - Returns: None.
Examples
>>> infer(config)