选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

UpdateModelPackage - Amazon SageMaker
此页面尚未翻译为您的语言。 请求翻译

UpdateModelPackage

Updates a versioned model.

Request Syntax

{ "AdditionalInferenceSpecificationsToAdd": [ { "Containers": [ { "AdditionalS3DataSource": { "CompressionType": "string", "ETag": "string", "S3DataType": "string", "S3Uri": "string" }, "ContainerHostname": "string", "Environment": { "string" : "string" }, "Framework": "string", "FrameworkVersion": "string", "Image": "string", "ImageDigest": "string", "ModelDataETag": "string", "ModelDataSource": { "S3DataSource": { "CompressionType": "string", "ETag": "string", "HubAccessConfig": { "HubContentArn": "string" }, "ManifestEtag": "string", "ManifestS3Uri": "string", "ModelAccessConfig": { "AcceptEula": boolean }, "S3DataType": "string", "S3Uri": "string" } }, "ModelDataUrl": "string", "ModelInput": { "DataInputConfig": "string" }, "NearestModelName": "string", "ProductId": "string" } ], "Description": "string", "Name": "string", "SupportedContentTypes": [ "string" ], "SupportedRealtimeInferenceInstanceTypes": [ "string" ], "SupportedResponseMIMETypes": [ "string" ], "SupportedTransformInstanceTypes": [ "string" ] } ], "ApprovalDescription": "string", "ClientToken": "string", "CustomerMetadataProperties": { "string" : "string" }, "CustomerMetadataPropertiesToRemove": [ "string" ], "InferenceSpecification": { "Containers": [ { "AdditionalS3DataSource": { "CompressionType": "string", "ETag": "string", "S3DataType": "string", "S3Uri": "string" }, "ContainerHostname": "string", "Environment": { "string" : "string" }, "Framework": "string", "FrameworkVersion": "string", "Image": "string", "ImageDigest": "string", "ModelDataETag": "string", "ModelDataSource": { "S3DataSource": { "CompressionType": "string", "ETag": "string", "HubAccessConfig": { "HubContentArn": "string" }, "ManifestEtag": "string", "ManifestS3Uri": "string", "ModelAccessConfig": { "AcceptEula": boolean }, "S3DataType": "string", "S3Uri": "string" } }, "ModelDataUrl": "string", "ModelInput": { "DataInputConfig": "string" }, "NearestModelName": "string", "ProductId": "string" } ], "SupportedContentTypes": [ "string" ], "SupportedRealtimeInferenceInstanceTypes": [ "string" ], "SupportedResponseMIMETypes": [ "string" ], "SupportedTransformInstanceTypes": [ "string" ] }, "ModelApprovalStatus": "string", "ModelCard": { "ModelCardContent": "string", "ModelCardStatus": "string" }, "ModelLifeCycle": { "Stage": "string", "StageDescription": "string", "StageStatus": "string" }, "ModelPackageArn": "string", "SourceUri": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AdditionalInferenceSpecificationsToAdd

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.

Type: Array of AdditionalInferenceSpecificationDefinition objects

Array Members: Minimum number of 1 item. Maximum number of 15 items.

Required: No

ApprovalDescription

A description for the approval status of the model.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: .*

Required: No

ClientToken

A unique token that guarantees that the call to this API is idempotent.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 36.

Pattern: ^[a-zA-Z0-9-]+$

Required: No

CustomerMetadataProperties

The metadata properties associated with the model package versions.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^([\p{L}\p{Z}\p{N}_.:\/=+\-@]*)${1,128}

Value Length Constraints: Minimum length of 1. Maximum length of 256.

Value Pattern: ^([\p{L}\p{Z}\p{N}_.:\/=+\-@]*)${1,256}

Required: No

CustomerMetadataPropertiesToRemove

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

Type: Array of strings

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: ^([\p{L}\p{Z}\p{N}_.:\/=+\-@]*)${1,128}

Required: No

InferenceSpecification

Specifies details about inference jobs that you can run with models based on this model package, including the following information:

  • The Amazon ECR paths of containers that contain the inference code and model artifacts.

  • The instance types that the model package supports for transform jobs and real-time endpoints used for inference.

  • The input and output content formats that the model package supports for inference.

Type: InferenceSpecification object

Required: No

ModelApprovalStatus

The approval status of the model.

Type: String

Valid Values: Approved | Rejected | PendingManualApproval

Required: No

ModelCard

The model card associated with the model package. Since ModelPackageModelCard is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of ModelCard. The ModelPackageModelCard schema does not include model_package_details, and model_overview is composed of the model_creator and model_artifact properties. For more information about the model package model card schema, see Model package model card schema. For more information about the model card associated with the model package, see View the Details of a Model Version.

Type: ModelPackageModelCard object

Required: No

ModelLifeCycle

A structure describing the current state of the model in its life cycle.

Type: ModelLifeCycle object

Required: No

ModelPackageArn

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^arn:aws(-cn|-us-gov|-iso-f)?:sagemaker:[a-z0-9\-]{9,16}:[0-9]{12}:model-package/[\S]{1,2048}$

Required: Yes

SourceUri

The URI of the source for the model package.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 1024.

Pattern: [\p{L}\p{M}\p{Z}\p{N}\p{P}]{0,1024}

Required: No

Response Syntax

{ "ModelPackageArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ModelPackageArn

The Amazon Resource Name (ARN) of the model.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^arn:aws(-cn|-us-gov|-iso-f)?:sagemaker:[a-z0-9\-]{9,16}:[0-9]{12}:model-package/[\S]{1,2048}$

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。