Pipeline API
Public API for the training pipeline driver.
- class pstrain.api.pipeline.PipelineContext(project_dir, experiment='default', config_name='default', feat=<factory>, train=<factory>, split=<factory>, runner=<factory>, sharding=<factory>, description='', resolved_config=None)[source]
Bases:
objectPer-run configuration for the training pipeline.
- Parameters:
- __init__(project_dir, experiment='default', config_name='default', feat=<factory>, train=<factory>, split=<factory>, runner=<factory>, sharding=<factory>, description='', resolved_config=None)
- all_fileids()[source]
Train + test fileids (post-split). Use audio_fileids() if you need the full corpus before split has run.
- audio_fileids(extension='.wav')[source]
All audio fileids, recursively derived from audio/**/*<ext>.
Returns sorted POSIX-style paths relative to the audio directory, without the extension. This is the canonical set of files that feature extraction operates on and is independent of whether the train/test split has run yet.
- feat: FeatParams
- property filler_dict_path: Path
Stable optional dependency path, including when the file is absent.
- fingerprint_payload(stage)[source]
Return the explicitly declared resolved values and identity keys.
- classmethod from_config(project_dir, *, experiment='default', config_name='default', cli_overrides=None)[source]
Build a context by reading project/etc/configs.yaml.
- provenance_document(stage)[source]
Serializable provenance, including its effective-config fingerprint.
- read_fileids(split)[source]
Read a fileid list (e.g. ‘train’, ‘test’, ‘dev’).
Returns an empty list if the file doesn’t exist (planning before corpus setup is allowed; tasks that need fileids will fail at run time with a clearer message).
- runner: RunnerParams
- sharding: ShardingParams
- split: SplitParams
- train: TrainParams
- exception pstrain.api.pipeline.UnknownTargetError[source]
Bases:
KeyErrorRaised when a build target is not registered with the pipeline.
- pstrain.api.pipeline.build_pipeline(ctx)[source]
Build a pipeline with all pstrain training tasks registered for ctx.
Feature-extraction tasks are expanded to one task per audio file found recursively under the audio directory. An empty or missing audio directory fails immediately during pipeline construction.
- Parameters:
ctx (PipelineContext)
- Return type:
Pipeline
- pstrain.api.pipeline.create_pipeline_context(project_dir, *, experiment='default', config_name='default', cli_overrides=None)[source]
Build a context by reading
project/etc/configs.yaml.PipelineContextis re-exported unchanged, so the public name and the library name are the same class. This factory gives the command line a public-API call frame without altering that class.
- pstrain.api.pipeline.run_pipeline(pipeline, target, *, dry_run=False, force=False, jobs=None, verbose=False)[source]
Run a training graph through a concrete public-API call frame.
- pstrain.api.pipeline.TARGETS
Registered pipeline targets.
- pstrain.api.pipeline.DEFAULT_TARGET
Default target selected for a pipeline build.
- pstrain.api.pipeline.DEFAULT_CONFIGS
Names of the bundled pipeline configurations.