SageMaker / Client / update_model_package

update_model_package#

SageMaker.Client.update_model_package(**kwargs)#

Updates a versioned model.

See also: AWS API Documentation

Request Syntax

response = client.update_model_package(
    ModelPackageArn='string',
    ModelApprovalStatus='Approved'|'Rejected'|'PendingManualApproval',
    ApprovalDescription='string',
    CustomerMetadataProperties={
        'string': 'string'
    },
    CustomerMetadataPropertiesToRemove=[
        'string',
    ],
    AdditionalInferenceSpecificationsToAdd=[
        {
            'Name': 'string',
            'Description': 'string',
            'Containers': [
                {
                    'ContainerHostname': 'string',
                    'Image': 'string',
                    'ImageDigest': 'string',
                    'ModelDataUrl': 'string',
                    'ProductId': 'string',
                    'Environment': {
                        'string': 'string'
                    },
                    'ModelInput': {
                        'DataInputConfig': 'string'
                    },
                    'Framework': 'string',
                    'FrameworkVersion': 'string',
                    'NearestModelName': 'string',
                    'AdditionalS3DataSource': {
                        'S3DataType': 'S3Object',
                        'S3Uri': 'string',
                        'CompressionType': 'None'|'Gzip'
                    }
                },
            ],
            'SupportedTransformInstanceTypes': [
                'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.m5.large'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge',
            ],
            'SupportedRealtimeInferenceInstanceTypes': [
                'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.large'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.12xlarge'|'ml.m5d.24xlarge'|'ml.c4.large'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.c5.large'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.large'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.12xlarge'|'ml.r5.24xlarge'|'ml.r5d.large'|'ml.r5d.xlarge'|'ml.r5d.2xlarge'|'ml.r5d.4xlarge'|'ml.r5d.12xlarge'|'ml.r5d.24xlarge'|'ml.inf1.xlarge'|'ml.inf1.2xlarge'|'ml.inf1.6xlarge'|'ml.inf1.24xlarge'|'ml.c6i.large'|'ml.c6i.xlarge'|'ml.c6i.2xlarge'|'ml.c6i.4xlarge'|'ml.c6i.8xlarge'|'ml.c6i.12xlarge'|'ml.c6i.16xlarge'|'ml.c6i.24xlarge'|'ml.c6i.32xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.12xlarge'|'ml.g5.16xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge'|'ml.p4d.24xlarge'|'ml.c7g.large'|'ml.c7g.xlarge'|'ml.c7g.2xlarge'|'ml.c7g.4xlarge'|'ml.c7g.8xlarge'|'ml.c7g.12xlarge'|'ml.c7g.16xlarge'|'ml.m6g.large'|'ml.m6g.xlarge'|'ml.m6g.2xlarge'|'ml.m6g.4xlarge'|'ml.m6g.8xlarge'|'ml.m6g.12xlarge'|'ml.m6g.16xlarge'|'ml.m6gd.large'|'ml.m6gd.xlarge'|'ml.m6gd.2xlarge'|'ml.m6gd.4xlarge'|'ml.m6gd.8xlarge'|'ml.m6gd.12xlarge'|'ml.m6gd.16xlarge'|'ml.c6g.large'|'ml.c6g.xlarge'|'ml.c6g.2xlarge'|'ml.c6g.4xlarge'|'ml.c6g.8xlarge'|'ml.c6g.12xlarge'|'ml.c6g.16xlarge'|'ml.c6gd.large'|'ml.c6gd.xlarge'|'ml.c6gd.2xlarge'|'ml.c6gd.4xlarge'|'ml.c6gd.8xlarge'|'ml.c6gd.12xlarge'|'ml.c6gd.16xlarge'|'ml.c6gn.large'|'ml.c6gn.xlarge'|'ml.c6gn.2xlarge'|'ml.c6gn.4xlarge'|'ml.c6gn.8xlarge'|'ml.c6gn.12xlarge'|'ml.c6gn.16xlarge'|'ml.r6g.large'|'ml.r6g.xlarge'|'ml.r6g.2xlarge'|'ml.r6g.4xlarge'|'ml.r6g.8xlarge'|'ml.r6g.12xlarge'|'ml.r6g.16xlarge'|'ml.r6gd.large'|'ml.r6gd.xlarge'|'ml.r6gd.2xlarge'|'ml.r6gd.4xlarge'|'ml.r6gd.8xlarge'|'ml.r6gd.12xlarge'|'ml.r6gd.16xlarge'|'ml.p4de.24xlarge'|'ml.trn1.2xlarge'|'ml.trn1.32xlarge'|'ml.inf2.xlarge'|'ml.inf2.8xlarge'|'ml.inf2.24xlarge'|'ml.inf2.48xlarge'|'ml.p5.48xlarge',
            ],
            'SupportedContentTypes': [
                'string',
            ],
            'SupportedResponseMIMETypes': [
                'string',
            ]
        },
    ]
)
Parameters:
  • ModelPackageArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the model package.

  • ModelApprovalStatus (string) – The approval status of the model.

  • ApprovalDescription (string) – A description for the approval status of the model.

  • CustomerMetadataProperties (dict) –

    The metadata properties associated with the model package versions.

    • (string) –

      • (string) –

  • CustomerMetadataPropertiesToRemove (list) –

    The metadata properties associated with the model package versions to remove.

    • (string) –

  • AdditionalInferenceSpecificationsToAdd (list) –

    An array of additional Inference Specification objects to be added to the existing array additional Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.

    • (dict) –

      A structure of additional Inference Specification. Additional Inference Specification specifies details about inference jobs that can be run with models based on this model package

      • Name (string) – [REQUIRED]

        A unique name to identify the additional inference specification. The name must be unique within the list of your additional inference specifications for a particular model package.

      • Description (string) –

        A description of the additional Inference specification

      • Containers (list) – [REQUIRED]

        The Amazon ECR registry path of the Docker image that contains the inference code.

        • (dict) –

          Describes the Docker container for the model package.

          • ContainerHostname (string) –

            The DNS host name for the Docker container.

          • Image (string) – [REQUIRED]

            The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.

            If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both registry/repository[:tag] and registry/repository[@digest] image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker.

          • ImageDigest (string) –

            An MD5 hash of the training algorithm that identifies the Docker image used for training.

          • ModelDataUrl (string) –

            The Amazon S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive ( .tar.gz suffix).

            Note

            The model artifacts must be in an S3 bucket that is in the same region as the model package.

          • ProductId (string) –

            The Amazon Web Services Marketplace product ID of the model package.

          • Environment (dict) –

            The environment variables to set in the Docker container. Each key and value in the Environment string to string map can have length of up to 1024. We support up to 16 entries in the map.

            • (string) –

              • (string) –

          • ModelInput (dict) –

            A structure with Model Input details.

            • DataInputConfig (string) – [REQUIRED]

              The input configuration object for the model.

          • Framework (string) –

            The machine learning framework of the model package container image.

          • FrameworkVersion (string) –

            The framework version of the Model Package Container Image.

          • NearestModelName (string) –

            The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model. You can find a list of benchmarked models by calling ListModelMetadata.

          • AdditionalS3DataSource (dict) –

            The additional data source that is used during inference in the Docker container for your model package.

            • S3DataType (string) – [REQUIRED]

              The data type of the additional data source that you specify for use in inference or training.

            • S3Uri (string) – [REQUIRED]

              The uniform resource identifier (URI) used to identify an additional data source used in inference or training.

            • CompressionType (string) –

              The type of compression used for an additional data source used in inference or training. Specify None if your additional data source is not compressed.

      • SupportedTransformInstanceTypes (list) –

        A list of the instance types on which a transformation job can be run or on which an endpoint can be deployed.

        • (string) –

      • SupportedRealtimeInferenceInstanceTypes (list) –

        A list of the instance types that are used to generate inferences in real-time.

        • (string) –

      • SupportedContentTypes (list) –

        The supported MIME types for the input data.

        • (string) –

      • SupportedResponseMIMETypes (list) –

        The supported MIME types for the output data.

        • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'ModelPackageArn': 'string'
}

Response Structure

  • (dict) –

    • ModelPackageArn (string) –

      The Amazon Resource Name (ARN) of the model.