czbenchmarks.models.implementations.base_model_implementation
Attributes
Classes
Abstract base class for model implementations. |
Module Contents
- czbenchmarks.models.implementations.base_model_implementation.logger
- class czbenchmarks.models.implementations.base_model_implementation.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
- 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.
Load and validate all datasets
Download model weights
Run inference
Save results
- Parameters:
datasets – List of datasets to process
- Raises:
FileNotFoundError – If no input datasets found