caikit.core.modules.config

Attributes

log

error

Classes

ModuleConfig

Config object used by all modules for config loading, saving, etc.

Module Contents

caikit.core.modules.config.log[source]
caikit.core.modules.config.error
class caikit.core.modules.config.ModuleConfig(config_dict)[source]

Bases: aconfig.Config

Config object used by all modules for config loading, saving, etc.

reserved_keys = ['model_path']
classmethod load(model_path: str | ModuleConfig) ModuleConfig[source]

Load a new module configuration from a directory on disk.

Args:
model_path (Union[str, ModuleConfig]): Path to model directory. At

the top level of directory is config.yml which holds info about the model. Note that the model_path here is assumed to be operating system correct as a consequence of the way this method is invoked by the model manager.

Returns:
model_config (ModuleConfig): Instantiated ModuleConfig for model

given model_path.

save(model_path)[source]

Save this module configuration to a top-level config.yml file in the specified model path.

Args: str

Path to model directory. The config.yml file will be written to this location.

Notes:

model_path must already exist! This means you must create the directory outside of this routine.