caikit.runtime.model_management.model_loader_base ================================================= .. py:module:: caikit.runtime.model_management.model_loader_base Attributes ---------- .. autoapisummary:: caikit.runtime.model_management.model_loader_base.log Classes ------- .. autoapisummary:: caikit.runtime.model_management.model_loader_base.ModelLoaderBase Module Contents --------------- .. py:data:: log .. py:class:: ModelLoaderBase(config: aconfig.Config, instance_name: str) Bases: :py:obj:`caikit.core.toolkit.factory.FactoryConstructible` Model Loader Base class which describes how models are loaded. .. py:attribute:: _load_thread_pool :value: None .. py:method:: load_module_instance(model_path: str, model_id: str, model_type: str, finder: Optional[Union[str, caikit.core.model_management.ModelFinderBase]] = None, initializer: Optional[Union[str, caikit.core.model_management.ModelInitializerBase]] = None) -> caikit.core.ModuleBase :abstractmethod: Load an instance of a Caikit Model Args: model_path (str): The model path to load from model_id (str): The model's id model_type (str): The type of model being load finder (Optional[Union[str, ModelFinderBase]], optional): The ModelFinder to use for loading. Defaults to None. initializer (Optional[Union[str, ModelInitializerBase]], optional): The ModelInitializer to use for loading. Defaults to None. Returns: ModuleBase: a loaded model .. py:method:: load_model(model_id: str, local_model_path: str, model_type: str, fail_callback: Optional[Callable] = None, retries: int = 0, finder: Optional[Union[str, caikit.core.model_management.ModelFinderBase]] = None, initializer: Optional[Union[str, caikit.core.model_management.ModelInitializerBase]] = None) -> caikit.runtime.model_management.loaded_model.LoadedModel Start loading a model from disk and associate the ID/size with it Args: model_id (str): Model ID string for the model to load. local_model_path (str): Local filesystem path to load the model from. model_type (str): Type of the model to load. fail_callback (Optional[Callable]): Optional no-arg callback to call on load failure retries (int): Number of times to retry loading Returns: model (LoadedModel) : The model that was loaded .. py:method:: _wrapped_load_model(model_path: str, model_id: str, model_type: str, finder: Optional[Union[str, caikit.core.model_management.ModelFinderBase]] = None, initializer: Optional[Union[str, caikit.core.model_management.ModelInitializerBase]] = None) -> Union[caikit.runtime.model_management.batcher.Batcher, caikit.core.ModuleBase] .. py:method:: _wrap_in_batcher_if_configured(caikit_core_model: caikit.core.ModuleBase, model_type: str, model_id: str) -> Union[caikit.runtime.model_management.batcher.Batcher, caikit.core.ModuleBase] Perform Batcher wrapping on the given module if configured, otherwise return the model as is