espnet3.systems.base.system.BaseSystem
espnet3.systems.base.system.BaseSystem
class espnet3.systems.base.system.BaseSystem(training_config: DictConfig | None = None, inference_config: DictConfig | None = None, metrics_config: DictConfig | None = None, publication_config: DictConfig | None = None, demo_config: DictConfig | None = None)
Bases: object
Base class for all ESPnet3 systems.
A system declares its stages as the class attribute stages: a tuple of StageSpec, in the order “all” runs them. Every public method a system defines (class-defined, not starting with _) must be one of these stage names - a system has no other public surface. See espnet3.contract.stages.check_stage_contract for the checks run when a subclass is defined, and espnet3.contract.stages.stage_log_dir for how a stage’s log directory is resolved.
Class Attributes: : DATASET_BUILDER_CLASS_NAME: Name of the builder class expected in each : dataset module (default "DatasetBuilder"). <br/> DATASET_CLASS_NAME: Name of the dataset class expected in each dataset : module (default "Dataset"). Used by subclasses that instantiate datasets directly. <br/> stages: The declared stage order (see above).
All behavior is config-driven.
- Parameters:
- training_config (DictConfig | None) – Training configuration.
- inference_config (DictConfig | None) – Inference configuration.
- metrics_config (DictConfig | None) – Measurement configuration.
- publication_config (DictConfig | None) – Publication configuration.
- demo_config (DictConfig | None) – Demo configuration.
Examples
>>> system = BaseSystem()
>>> [s.name for s in system.stages[:3]]
['create_dataset', 'collect_stats', 'train']Initialize the system with optional stage configs.
- Parameters:
- training_config – Training configuration for data preparation, statistics collection, and model training.
- inference_config – Inference configuration used by the
inferstage. - metrics_config – Measurement configuration used by the
measurestage. - publication_config – Publication configuration for
pack_modelandupload_modelstages. - demo_config – Demo configuration for the
demostage.
DATASET_BUILDER_CLASS_NAME = 'DatasetBuilder'
DATASET_CLASS_NAME = 'Dataset'
collect_stats(*args, **kwargs)
Collect statistics needed for training.
Reads the same dataset: block as train. By default the DataOrganizer is built with train_mode=False, so the train preprocessor’s augmentation (data_aug_effects, speed perturbation and so on) is not applied, as in ESPnet2: the statistics and the shape files the sampler batches by are then the same on every run. train still augments. To collect statistics with the augmentation applied, set it in the training config:
collect_stats_train_mode: truecreate_dataset(*args, **kwargs)
Create datasets from dataset references.
infer(*args, **kwargs)
Run inference on the configured datasets.
measure(*args, **kwargs)
Compute evaluation metrics from hypothesis/reference outputs.
pack_demo(*args, **kwargs)
Pack demo assets into a runnable demo directory.
pack_model(*args, **kwargs)
Pack model artifacts into an espnet3 bundle.
stages : ClassVar[tuple[StageSpec, ...]] = (StageSpec(name='create_dataset', config='training', log_dir='data_dir'), StageSpec(name='collect_stats', config='training', log_dir='stats_dir'), StageSpec(name='train', config='training', log_dir='exp_dir'), StageSpec(name='infer', config='inference', log_dir='inference_dir'), StageSpec(name='measure', config='metrics', log_dir='inference_dir'), StageSpec(name='pack_model', config=('training', 'publication'), log_dir=None), StageSpec(name='upload_model', config='publication', log_dir=None), StageSpec(name='pack_demo', config='demo', log_dir='pack.out_dir'), StageSpec(name='upload_demo', config='demo', log_dir='pack.out_dir'))
train(*args, **kwargs)
Train the system model.
upload_demo(*args, **kwargs)
Upload demo bundle to HuggingFace.
upload_model(*args, **kwargs)
Upload model bundle to HuggingFace.
