InferenceConfig class

Definition

Model deployment config specific to model deployments - requires entry_script and runtime.

InferenceConfig(entry_script, runtime, conda_file=None, extra_docker_file_steps=None, source_directory=None, enable_gpu=None, description=None, base_image=None, base_image_registry=None, cuda_version=None)
Inheritance
builtins.object
InferenceConfig

Parameters

entry_script
str

Path to local file that contains the code to run for the image

runtime
str

Which runtime to use for the image. Current supported runtimes are 'spark-py' and 'python'

conda_file
str

Path to local file containing a conda environment definition to use for the image

extra_docker_file_steps
str

Path to local file containing additional Docker steps to run when setting up image

source_directory
: str

paths to folders that contains all files to create the image

enable_gpu
bool

Whether or not to enable GPU support in the image. The GPU image must be used on Microsoft Azure Services such as Azure Container Instances, Azure Machine Learning Compute, Azure Virtual Machines, and Azure Kubernetes Service. Defaults to False

description
str

A description to give this image

base_image
str

A custom image to be used as base image. If no base image is given then the base image will be used based off of given runtime parameter.

base_image_registry
ContainerRegistry

Image registry that contains the base image.

cuda_version
str

Version of CUDA to install for images that need GPU support. The GPU image must be used on Microsoft Azure Services such as Azure Container Instances, Azure Machine Learning Compute, Azure Virtual Machines, and Azure Kubernetes Service. Supported versions are 9.0, 9.1, and 10.0. If 'enable_gpu' is set, this defaults to '9.1'.

Methods

build_create_payload(workspace, name, model_ids)

Build the creation payload for the Container image.

build_profile_payload(profile_name, input_data)

Build the profiling payload for the Model package.

validate_configuration()

Check that the specified configuration values are valid.

Will raise a WebserviceException if validation fails.

build_create_payload(workspace, name, model_ids)

Build the creation payload for the Container image.

build_create_payload(workspace, name, model_ids)

Parameters

workspace
Workspace

The workspace object to create the image in

name
str

The name of the image

model_ids
<xref:azureml.core.model.list[str]>

A list of model IDs to package into the image

Returns

Container image creation payload

Return type

build_profile_payload(profile_name, input_data)

Build the profiling payload for the Model package.

build_profile_payload(profile_name, input_data)

Parameters

profile_name
str

The name of the profile

input_data
str

The input data for profiling

Returns

Model profile payload

Return type

validate_configuration()

Check that the specified configuration values are valid.

Will raise a WebserviceException if validation fails.

validate_configuration()