create_model_package
async
¶
create_model_package(
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
model_package_name: Optional[EntityName] = None,
model_package_group_name: Optional[ArnOrName] = None,
model_package_description: Optional[EntityDescription] = None,
model_package_registration_type: Optional[ModelPackageRegistrationType] = None,
inference_specification: Optional[InferenceSpecification] = None,
validation_specification: Optional[ModelPackageValidationSpecification] = None,
source_algorithm_specification: Optional[SourceAlgorithmSpecification] = None,
certify_for_marketplace: Optional[CertifyForMarketplace] = None,
tags: Optional[TagList] = None,
model_approval_status: Optional[ModelApprovalStatus] = None,
metadata_properties: Optional[MetadataProperties] = None,
model_metrics: Optional[ModelMetrics] = None,
client_token: Optional[ClientToken] = None,
domain: Optional[String] = None,
task: Optional[String] = None,
sample_payload_url: Optional[S3Uri] = None,
customer_metadata_properties: Optional[CustomerMetadataMap] = None,
drift_check_baselines: Optional[DriftCheckBaselines] = None,
additional_inference_specifications: Optional[
AdditionalInferenceSpecifications
] = None,
skip_model_validation: Optional[SkipModelValidation] = None,
source_uri: Optional[ModelPackageSourceUri] = None,
security_config: Optional[ModelPackageSecurityConfig] = None,
model_card: Optional[ModelPackageModelCard] = None,
model_life_cycle: Optional[ModelLifeCycle] = None,
managed_storage_type: Optional[ManagedStorageType] = None,
) -> CreateModelPackageOutput
Creates a model package that you can use to create SageMaker models or list on Amazon Web Services Marketplace, or a versioned model that is part of a model group. Buyers can subscribe to model packages listed on Amazon Web Services Marketplace to create models in SageMaker.
To create a model package by specifying a Docker container that contains your inference code and the Amazon S3 location of your model artifacts, provide values for InferenceSpecification. To create a model from an algorithm resource that you created or subscribed to in Amazon Web Services Marketplace, provide a value for SourceAlgorithmSpecification.
There are two types of model packages:
-
Versioned - a model that is part of a model group in the model registry.
-
Unversioned - a model package that is not part of a model group.
Parameters:
-
model_package_name(Optional[EntityName], default:None) –The name of the model package. The name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).
This parameter is required for unversioned models. It is not applicable to versioned models.
-
model_package_group_name(Optional[ArnOrName], default:None) –The name or Amazon Resource Name (ARN) of the model package group that this model version belongs to.
This parameter is required for versioned models, and does not apply to unversioned models.
-
model_package_description(Optional[EntityDescription], default:None) –A description of the model package.
-
model_package_registration_type(Optional[ModelPackageRegistrationType], default:None) –The package registration type of the model package input.
-
inference_specification(Optional[InferenceSpecification], default:None) –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.
-
-
validation_specification(Optional[ModelPackageValidationSpecification], default:None) –Specifies configurations for one or more transform jobs that SageMaker runs to test the model package.
-
source_algorithm_specification(Optional[SourceAlgorithmSpecification], default:None) –Details about the algorithm that was used to create the model package.
-
certify_for_marketplace(Optional[CertifyForMarketplace], default:None) –Whether to certify the model package for listing on Amazon Web Services Marketplace.
This parameter is optional for unversioned models, and does not apply to versioned models.
-
tags(Optional[TagList], default:None) –A list of key value pairs associated with the model. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.
If you supply
ModelPackageGroupName, your model package belongs to the model group you specify and uses the tags associated with the model group. In this case, you cannot supply atagargument. -
model_approval_status(Optional[ModelApprovalStatus], default:None) –Whether the model is approved for deployment.
This parameter is optional for versioned models, and does not apply to unversioned models.
For versioned models, the value of this parameter must be set to
Approvedto deploy the model. -
model_metrics(Optional[ModelMetrics], default:None) –A structure that contains model metrics reports.
-
client_token(Optional[ClientToken], default:None) –A unique token that guarantees that the call to this API is idempotent.
-
domain(Optional[String], default:None) –The machine learning domain of your model package and its components. Common machine learning domains include computer vision and natural language processing.
-
task(Optional[String], default:None) –The machine learning task your model package accomplishes. Common machine learning tasks include object detection and image classification. The following tasks are supported by Inference Recommender:
"IMAGE_CLASSIFICATION"|"OBJECT_DETECTION"|"TEXT_GENERATION"|"IMAGE_SEGMENTATION"|"FILL_MASK"|"CLASSIFICATION"|"REGRESSION"|"OTHER".Specify "OTHER" if none of the tasks listed fit your use case.
-
sample_payload_url(Optional[S3Uri], default:None) –The Amazon Simple Storage Service (Amazon S3) path where the sample payload is stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix). This archive can hold multiple files that are all equally used in the load test. Each file in the archive must satisfy the size constraints of the InvokeEndpoint call.
-
customer_metadata_properties(Optional[CustomerMetadataMap], default:None) –The metadata properties associated with the model package versions.
-
drift_check_baselines(Optional[DriftCheckBaselines], default:None) –Represents the drift check baselines that can be used when the model monitor is set using the model package. For more information, see the topic on Drift Detection against Previous Baselines in SageMaker Pipelines in the Amazon SageMaker Developer Guide.
-
additional_inference_specifications(Optional[AdditionalInferenceSpecifications], default:None) –An array of additional Inference Specification objects. 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.
-
skip_model_validation(Optional[SkipModelValidation], default:None) –Indicates if you want to skip model validation.
-
source_uri(Optional[ModelPackageSourceUri], default:None) –The URI of the source for the model package. If you want to clone a model package, set it to the model package Amazon Resource Name (ARN). If you want to register a model, set it to the model ARN.
-
security_config(Optional[ModelPackageSecurityConfig], default:None) –The KMS Key ID (
KMSKeyId) used for encryption of model package information. -
model_card(Optional[ModelPackageModelCard], default:None) –The model card associated with the model package. Since
ModelPackageModelCardis tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema ofModelCard. TheModelPackageModelCardschema does not includemodel_package_details, andmodel_overviewis composed of themodel_creatorandmodel_artifactproperties. 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. -
model_life_cycle(Optional[ModelLifeCycle], default:None) –A structure describing the current state of the model in its life cycle.
-
managed_storage_type(Optional[ManagedStorageType], default:None) –The storage type of the model package.
Raises:
-
ConflictException–There was a conflict when you attempted to modify a SageMaker entity such as an
ExperimentorArtifact. -
ResourceLimitExceeded–You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 | |