czbenchmarks.runner
Attributes
Classes
Handles Docker container execution logic for running models |
Functions
|
Convenience function to run inference on a single dataset. |
Module Contents
- czbenchmarks.runner.logger
- class czbenchmarks.runner.ContainerRunner(model_name: str | czbenchmarks.models.types.ModelType, gpu: bool = False, interactive: bool = False, app_mount_dir: str | None = None, environment: Dict[str, str] | None = None, custom_config_path: str | None = None, **kwargs: Any)[source]
Handles Docker container execution logic for running models in isolated environments
- client
- image
- model_type
- app_mount_dir = None
- gpu = False
- interactive = False
- cli_args
- environment
- run(datasets: czbenchmarks.datasets.BaseDataset | List[czbenchmarks.datasets.BaseDataset]) czbenchmarks.datasets.BaseDataset | List[czbenchmarks.datasets.BaseDataset] [source]
Run the model on one or more datasets.
- Parameters:
datasets – A single dataset or list of datasets to process
- Returns:
The processed dataset(s) with model outputs attached
- czbenchmarks.runner.run_inference(model_name: str, dataset: czbenchmarks.datasets.BaseDataset, gpu: bool = True, interactive: bool = False, app_mount_dir: str | None = None, environment: Dict[str, str] | None = None, custom_config_path: str | None = None, **kwargs) czbenchmarks.datasets.BaseDataset [source]
Convenience function to run inference on a single dataset.
- Parameters:
model_name – Name of the model to run
dataset – Dataset to process
gpu – Whether to use GPU acceleration
interactive – Whether to run in interactive mode
app_mount_dir – Optional directory to mount to /app in the container (this will override the default /app mount from the docker build!)
environment – Dictionary of environment variables to pass to the container
custom_config_path – Path to a custom models.yaml file
**kwargs – Additional arguments to pass to the container as CLI params
- Returns:
The processed dataset with model outputs attached