snowflake.ml.model

Core Classes

Model()

Model Object containing multiple versions.

ModelVersion()

Model Version Object representing a specific version of the model that could be run.

HuggingFacePipelineModel([task, model, ...])

Utility factory method to build a wrapper over transformers [Pipeline].

Batch Inference

InputSpec(*[, params, column_handling])

Specification for batch inference input options.

OutputSpec(*, stage_location[, mode])

Specification for batch inference output.

JobSpec(*[, image_repo, job_name, ...])

Specification for batch inference job execution.

SaveMode(value)

Save mode options for batch inference output.

InputFormat(value)

The format of the input column data.

FileEncoding(value)

The encoding of the file content that will be passed to the custom model.

ColumnHandlingOptions

Options for handling specific columns during run_batch for file I/O.

Model Logging Options

CodePath(root[, filter])

Specifies a code path with optional filtering for selective inclusion.

ExportMode(value)

An enumeration.

Volatility(value)

Volatility levels for model functions.

snowflake.ml.model.custom_model

Classes

MethodRef(model_ref, method_name)

Represents a method invocation of an instance of ModelRef.

ModelRef(name, model)

Represents a model in the inference graph.

ModelContext(*[, artifacts, models])

Context for a custom model storing paths to file artifacts and model object references.

CustomModel([context])

Abstract class for user defined custom model.

Decorators

inference_api(func)

Decorator to mark a method as an inference API in a CustomModel.

partitioned_api(func)

Decorator to mark a method as a partitioned inference API in a CustomModel.

snowflake.ml.model.model_signature

Classes

DataType(value)

An enumeration.

BaseFeatureSpec(name, shape)

Abstract Class for specification of a feature.

FeatureSpec(name, dtype[, shape, nullable])

Specification of a feature in Snowflake native model packaging.

FeatureGroupSpec(name, specs[, shape])

Specification of a group of features in Snowflake native model packaging.

ParamSpec(name, dtype, default_value[, shape])

Specification of a parameter in Snowflake native model packaging.

ParamGroupSpec(name, specs[, shape])

Specification of a group of parameters in Snowflake native model packaging.

ModelSignature(inputs, outputs[, params])

Signature of a model that specifies the input and output of a model.

Methods

infer_signature(input_data, output_data[, ...])

Infer model signature from given input and output sample data.

snowflake.ml.model.openai_signatures

Attributes

OPENAI_CHAT_SIGNATURE

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

OPENAI_CHAT_SIGNATURE_WITH_CONTENT_FORMAT_STRING

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

OPENAI_CHAT_WITH_PARAMS_SIGNATURE

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

OPENAI_CHAT_WITH_PARAMS_SIGNATURE_WITH_CONTENT_FORMAT_STRING

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).