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') | |
sagemaker_runtime = boto3.client("sagemaker-runtime", region_name='us-east-1') | |
# Specify the location of the input. | |
input_location = "<Path to your csv file in S3>" | |
# The name of the endpoint. The name must be unique within an AWS Region in your AWS account. | |
endpoint_name='titanic-survival-async-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-async-endpoint-config' | |
print(endpoint_config_name) | |
create_endpoint_config_response = sm_client.create_endpoint_config( | |
EndpointConfigName=endpoint_config_name, # You will specify this name in a CreateEndpoint request. | |
# List of ProductionVariant objects, one for each model that you want to host at this 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", |
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') | |
sagemaker_runtime = boto3.client("sagemaker-runtime", region_name='us-east-1') | |
# The name of the endpoint. The name must be unique within an AWS Region in your AWS account. | |
endpoint_name='titanic-survival-endpoint1' | |
# After you deploy a model into production using SageMaker hosting | |
# services, your client applications use this API to get inferences |
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_name = 'titanic-survival-endpoint' | |
endpoint_config_name = 'titanic-survival-endpoint-config' | |
print("EndpointName={}".format(endpoint_name)) | |
create_endpoint_response = sm_client.create_endpoint( | |
EndpointName=endpoint_name, | |
EndpointConfigName=endpoint_config_name) |
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-endpoint-config' | |
print(endpoint_config_name) | |
create_endpoint_config_response = sm_client.create_endpoint_config( | |
EndpointConfigName = endpoint_config_name, | |
ProductionVariants=[{ | |
'InstanceType':'ml.m4.xlarge', | |
'InitialVariantWeight':1, |
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 | |
from datetime import datetime | |
sm_client = boto3.client('sagemaker', region_name='us-east-1') | |
model_name = 'titanic-survival-v1' | |
print("Model name : {}".format(model_name)) | |
container_list = [{'ModelPackageName': 'arn:aws:sagemaker:us-east-1:...:model-package/titanic-survival/3'}] |
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') | |
model_url = "s3://sagemaker-us-east-1-.../sagemaker-scikit-learn-.../output/model.tar.gz" | |
modelpackage_inference_specification = { | |
"InferenceSpecification": { | |
"Containers": [ |
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 os | |
import sagemaker | |
import boto3 | |
iam_client = boto3.client('iam') | |
role = iam_client.get_role(RoleName='AmazonSageMaker-ExecutionRole-xyz')['Role']['Arn'] | |
sm_client = boto3.client('sagemaker', region_name="us-east-1") | |
model_package_group_name = "Titanic-survival" | |
model_package_group_input_dict = { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder