AWS sagemaker documentation change
Summary
Removed legacy SageMaker Python SDK v2 code examples for pipeline model deployment and real-time prediction calls.
Security assessment
Documentation update removing deprecated implementation examples. No security-related content added or modified.
Diff
diff --git a/sagemaker/latest/dg/inference-pipeline-real-time.md b/sagemaker/latest/dg/inference-pipeline-real-time.md index d73136108..c15e62921 100644 --- a//sagemaker/latest/dg/inference-pipeline-real-time.md +++ b//sagemaker/latest/dg/inference-pipeline-real-time.md @@ -30,3 +29,0 @@ The following code creates and deploys a real-time inference pipeline model with -SageMaker Python SDK v3 - - @@ -53,17 +49,0 @@ SageMaker Python SDK v3 -SageMaker Python SDK v2 (Legacy) - - - - from sagemaker.model import Model - from sagemaker.pipeline_model import PipelineModel - from sagemaker.sparkml.model import SparkMLModel - - sparkml_data = 's3://{}/{}/{}'.format(s3_model_bucket, s3_model_key_prefix, 'model.tar.gz') - sparkml_model = SparkMLModel(model_data=sparkml_data) - xgb_model = Model(model_data=xgb_model.model_data, image=training_image) - - model_name = 'serial-inference-' + timestamp_prefix - endpoint_name = 'serial-inference-ep-' + timestamp_prefix - sm_model = PipelineModel(name=model_name, role=role, models=[sparkml_model, xgb_model]) - sm_model.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge', endpoint_name=endpoint_name) - @@ -74,3 +53,0 @@ The following example shows how to make real-time predictions by calling an infe -SageMaker Python SDK v3 - - @@ -126,52 +102,0 @@ SageMaker Python SDK v3 -SageMaker Python SDK v2 (Legacy) - - - - import sagemaker - from sagemaker.predictor import json_serializer, json_deserializer, Predictor - - payload = { - "input": [ - { - "name": "Pclass", - "type": "float", - "val": "1.0" - }, - { - "name": "Embarked", - "type": "string", - "val": "Q" - }, - { - "name": "Age", - "type": "double", - "val": "48.0" - }, - { - "name": "Fare", - "type": "double", - "val": "100.67" - }, - { - "name": "SibSp", - "type": "double", - "val": "1.0" - }, - { - "name": "Sex", - "type": "string", - "val": "male" - } - ], - "output": { - "name": "features", - "type": "double", - "struct": "vector" - } - } - - predictor = Predictor(endpoint=endpoint_name, sagemaker_session=sagemaker.Session(), serializer=json_serializer, - content_type='text/csv', accept='application/json') - - print(predictor.predict(payload)) -