Created
August 11, 2022 08:13
-
-
Save gleeb/26b511e570f82af451dd4ef6ce8f1515 to your computer and use it in GitHub Desktop.
sagemaker deploy serverless endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
sm_client = boto3.client('sagemaker', region_name='us-east-1') | |
endpoint_config_name = 'titanic-survival-serverless-endpoint-config' | |
print(endpoint_config_name) | |
create_endpoint_config_response = sm_client.create_endpoint_config( | |
EndpointConfigName = endpoint_config_name, | |
ProductionVariants=[ { | |
"ModelName": "titanic-survival-v1", | |
"VariantName": "AllTraffic", | |
"ServerlessConfig": { | |
"MemorySizeInMB": 1024, | |
"MaxConcurrency": 20 | |
} | |
} ]) | |
endpoint_name = 'titanic-survival-serverless-endpoint' | |
print("EndpointName={}".format(endpoint_name)) | |
create_endpoint_response = sm_client.create_endpoint( | |
EndpointName=endpoint_name, | |
EndpointConfigName=endpoint_config_name) | |
print(create_endpoint_response['EndpointArn']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment