caikit.core.model_management.model_trainer_base

A Trainer is responsible for managing execution of a training job for a given module class

Configuration for ModelTrainers lives under the config as follows:

model_management:
trainers:
<trainer name>:

type: <trainer type name> config:

<config option>: <value>

Classes

TrainingInfo

ModelTrainerFutureBase

Every JobBase implementation must have a JobFutureBase class that can access the

ModelTrainerBase

A class can be constructed by a factory if its constructor takes exactly

Module Contents

class caikit.core.model_management.model_trainer_base.TrainingInfo[source]

Bases: caikit.core.model_management.job_base.JobInfo

class caikit.core.model_management.model_trainer_base.ModelTrainerFutureBase(*args, **kwargs)[source]

Bases: caikit.core.model_management.job_base.JobFutureBase

Every JobBase implementation must have a JobFutureBase class that can access the job information in the infrastructure managed by the task.

_save_path
property save_path: str | None

If created with a save path, the future must expose it, including any injected background id

abstract load() caikit.core.modules.ModuleBase[source]

A model future must be loadable with no additional arguments. Mainly useful in train results

result() caikit.core.modules.ModuleBase[source]

The result of a model train future is the loaded model

class caikit.core.model_management.model_trainer_base.ModelTrainerBase(config: aconfig.Config, instance_name: str)[source]

Bases: caikit.core.model_management.job_base.JobBase

A class can be constructed by a factory if its constructor takes exactly one argument that is an aconfig.Config object and it has a name to identify itself with the factory.

__doc__ = Multiline-String
Show Value
"""
A Trainer is responsible for managing execution of a training job for a given
module class

Configuration for ModelTrainers lives under the config as follows:

model_management:
    trainers:
        <trainer name>:
            type: <trainer type name>
            config:
                <config option>: <value>
"""
ModelFutureBase
abstract train(module_class: Type[caikit.core.modules.ModuleBase], *args, save_path: str | caikit.interfaces.common.data_model.stream_sources.S3Path | None = None, save_with_id: bool = False, model_name: str | None = None, **kwargs) ModelFutureBase[source]

Start training the given module and return a future to the trained model instance

abstract get_model_future(training_id: str) ModelFutureBase[source]

Look up the model future for the given id

get_future(job_id: str) caikit.core.model_management.job_base.JobFutureBase[source]

Look up the model future for the given id

classmethod get_trainer_name(training_id: str) str[source]

Un-hash the trainer’s instance name from the given training id