snowflake.ml.model.custom_model.ModelRef

class snowflake.ml.model.custom_model.ModelRef(name: str, model: Union[CustomModel, sklearn.base.BaseEstimator, sklearn.pipeline.Pipeline, xgboost.XGBModel, xgboost.Booster, torch.nn.Module, torch.jit.ScriptModule, tensorflow.Module, base.BaseEstimator, mlflow.pyfunc.PyFuncModel, transformers.Pipeline, HuggingFacePipelineModel, snowflake.ml.model.models.llm.LLM])

Bases: object

Represents a model in the inference graph. Methods can be directly called using this reference object as if with the original model object.

This enables us to separate the physical and logical representation of a model, allowing for a deep understanding of the graph and enabling optimization at the entire graph level.

Initialize the ModelRef.

Args:

name: The name of the model to refer to. model: The model object.

Attributes

model

The model object of the sub-model.

name

The name of the sub-model.