czbenchmarks.models.implementations

Submodules

Classes

BaseModelImplementation

Abstract base class for model implementations.

Package Contents

class czbenchmarks.models.implementations.BaseModelImplementation(**user_kwargs)[source]

Bases: czbenchmarks.models.validators.base_model_validator.BaseModelValidator, abc.ABC

Abstract base class for model implementations.

Handles common model operations like: - Loading datasets - Downloading model weights - Running inference - Saving results

datasets: List[czbenchmarks.datasets.BaseDataset]

List of datasets to process

model_weights_dir: str

Directory containing model weights

args: argparse.Namespace

Parsed command-line arguments

abstract get_model_weights_subdir(dataset: czbenchmarks.datasets.BaseDataset) str[source]

Get subdirectory for model variant weights.

Parameters:

dataset – Dataset being processed

Returns:

Subdirectory path or empty string if not needed

download_model_weights(dataset: czbenchmarks.datasets.BaseDataset) None[source]

Download and verify model weights.

Parameters:

dataset – Dataset being processed

abstract run_model(dataset: czbenchmarks.datasets.BaseDataset) None[source]

Implement model-specific inference logic

parse_args() argparse.Namespace[source]

Centralized argument parsing using subclass-defined parser

create_parser() argparse.ArgumentParser | None[source]

Subclasses implement to define their CLI arguments

run(datasets: czbenchmarks.datasets.BaseDataset | List[czbenchmarks.datasets.BaseDataset] | None = None)[source]

Run the full model pipeline.

  1. Load and validate all datasets

  2. Download model weights

  3. Run inference

  4. Save results

Parameters:

datasets – List of datasets to process

Raises:

FileNotFoundError – If no input datasets found