caikit.core.model_management.model_finder_base
A ModelFinder is responsible for finding models based on a unique input string which may be a path, id, or other identifier.
Configuration for ModelFinders lives under the config as follows:
- model_management:
- finders:
- <finder name>:
type: <finder type name> config:
<config option>: <value>
Classes
A class can be constructed by a factory if its constructor takes exactly |
Module Contents
- class caikit.core.model_management.model_finder_base.ModelFinderBase(config: aconfig.Config, instance_name: str)[source]
Bases:
caikit.core.toolkit.factory.FactoryConstructibleA 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 ModelFinder is responsible for finding models based on a unique input string which may be a path, id, or other identifier. Configuration for ModelFinders lives under the config as follows: model_management: finders: <finder name>: type: <finder type name> config: <config option>: <value> """
- abstract find_model(model_path: str, **kwargs) caikit.core.modules.ModuleConfig | None[source]
Find any model that can be uniquely identified by the given (logical) path. If found, return the in-memory ModuleConfig.
- Args:
- model_path (str): The logical path to the model (name, id, file
path, etc…)
- **kwargs: All finders must allow additional kwargs through so that
specific finders and loaders can support additional optional arguments.
- Returns:
- result (Optional[ModuleConfig]): If found, the in-memory config
object for the model. If the model cannot be found, an exception may be raised or None returned.