internal(ModelManager): add instantiate method

This commit is contained in:
Kevin Turner 2023-07-28 22:30:25 -07:00
parent bc9a5038fd
commit 86b8b69e88

View File

@ -540,6 +540,15 @@ class ModelManager(object):
model_class = MODEL_CLASSES[base_model][model_type]
return model_class
def _instantiate(self, model_name: str, base_model: BaseModelType, model_type: ModelType,
submodel_type: SubModelType = None) -> ModelBase:
model_config = self._get_model_config(base_model, model_name, model_type)
model_path, is_submodel_override = self._get_model_path(model_config, submodel_type)
# FIXME: do non-overriden submodels get the right class?
constructor = self._get_implementation(base_model, model_type)
instance = constructor(model_path, base_model, model_type)
return instance
def model_info(
self,
model_name: str,