简体   繁体   中英

Retrieve model endpoint given a Model Package Group in SageMaker?

Given a Model Package Group name, and a Model Package, I want to implement an API that returns me the endpoint for the latest version of that Model Package.

What's the API in Java SDK that for a given Model Package and a specific version I get the correspondent endpoint?

Clarification update: the model package (with its version) have already been deployed. The purpose of the API is to retrieve the already existing endpoint, and I don't know how to do this in Java.

In Python it would be something like:

model_artifact_summary = list(Artifact.list(source_uri=model_package_arn))[0]
model_artifact = ModelArtifact.load(artifact_arn=model_artifact_summary.artifact_arn)
endpoints = model_artifact.endpoint_contexts()

But I can't figure out the Java equivalent.

From a model package group you can create a deployable model. Using this SageMaker Model entity that you have created you will want to create an Endpoint Configuration: This is the details for the endpoint, instance type and instance count etc. Using this Endpoint Configuration you can create an Endpoint. These two steps can be orchestrated through either the Console or the SDK of your choice.

Create Endpoint Config Java API Call: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/sagemaker/model/CreateEndpointConfigResponse.html

Create Endpoint Java API Call: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/sagemaker/model/CreateEndpointResponse.html

Java SDK SageMaker Client Docs: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/sagemaker/SageMakerClient.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM