caikit.runtime.servicers.global_train_servicer

Attributes

log

error

NON_PRIMITIVE_TYPES

Classes

GlobalTrainServicer

Something something about the train servicer

Module Contents

caikit.runtime.servicers.global_train_servicer.log[source]
caikit.runtime.servicers.global_train_servicer.error
caikit.runtime.servicers.global_train_servicer.NON_PRIMITIVE_TYPES
class caikit.runtime.servicers.global_train_servicer.GlobalTrainServicer(training_service: caikit.runtime.service_factory.ServicePackage)[source]

Something something about the train servicer

_training_service
_model_manager = None
cdm
library
property training_output_dir: str
property save_with_id: str
Train(request: google.protobuf.message.Message, context: grpc.ServicerContext, *_, **__) caikit.interfaces.runtime.data_model.TrainingJob[source]

Global train RPC – Mocks the invocation of a Caikit Library module.train() method for a loaded Caikit Library model

Args:

request (object): A deserialized RPC request message context (ServicerContext): Context object (contains request metadata, etc)

Returns:
caikit.interfaces.runtime.data_model.TrainingJob:

A TrainingJob data model response object

run_training_job(request: google.protobuf.message.Message, module: Type[caikit.core.ModuleBase], training_output_dir: str | None = None, *, context: grpc.ServicerContext | None = None, wait: bool = False, **kwargs) caikit.interfaces.runtime.data_model.TrainingJob[source]

Builds the request dict for calling the train function asynchronously, then returns the thread id

Args:

request (ProtoMessageType): The message that stimulated this request module (Type[ModuleBase]): The module class to train training_output_dir (Optional[str]): The base directory where

the trained model should be saved, falling back to the configured output dir if not given.

Kwargs:
context (Optional[ServicerContext]): The grpc context for the

request if called from a grpc handler

wait (bool): Whether or not to block until the training is complete

Returns:
training_job (TrainingJob): The job handle for the training with the

job’s ID and the model’s name