쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

엔드포인트 호출

포커스 모드
엔드포인트 호출 - Amazon SageMaker AI

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

애플리케이션과 함께 프로덕션 환경에서 Amazon SageMaker SageMaker Canvas 모델을 사용할 수 있습니다. 다른 SageMaker AI 실시간 엔드포인트를 호출하는 것과 동일한 방식으로 프로그래밍 방식으로 엔드포인트를 호출합니다. 엔드포인트를 프로그래밍 방식으로 간접 호출하면 배포 테스트에서 언급한 것과 동일한 필드를 포함하는 응답 객체가 반환됩니다.

엔드포인트를 프로그래밍 방식으로 호출하는 방법에 대한 자세한 내용은 실시간 추론을 위한 모델 호출을 참조하세요.

다음 Python 예제는 모델 유형에 따라 엔드포인트를 호출하는 방법을 보여줍니다.

다음 예시에서는 엔드포인트에 배포한 JumpStart 파운데이션 모델을 간접 호출하는 방법을 보여줍니다.

import boto3 import pandas as pd client = boto3.client("runtime.sagemaker") body = pd.DataFrame( [['feature_column1', 'feature_column2'], ['feature_column1', 'feature_column2']] ).to_csv(header=False, index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

JumpStart 파운데이션 모델

다음 예시에서는 엔드포인트에 배포한 JumpStart 파운데이션 모델을 간접 호출하는 방법을 보여줍니다.

import boto3 import pandas as pd client = boto3.client("runtime.sagemaker") body = pd.DataFrame( [['feature_column1', 'feature_column2'], ['feature_column1', 'feature_column2']] ).to_csv(header=False, index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

다음 예시에서는 숫자 또는 범주형 예측 모델을 호출하는 방법을 보여줍니다.

import boto3 import pandas as pd client = boto3.client("runtime.sagemaker") body = pd.DataFrame(['feature_column1', 'feature_column2'], ['feature_column1', 'feature_column2']).to_csv(header=False, index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

다음 예시에서는 숫자 또는 범주형 예측 모델을 호출하는 방법을 보여줍니다.

import boto3 import pandas as pd client = boto3.client("runtime.sagemaker") body = pd.DataFrame(['feature_column1', 'feature_column2'], ['feature_column1', 'feature_column2']).to_csv(header=False, index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

다음 예시에서는 시계열 예측 모델을 간접 호출하는 방법을 보여줍니다. 시계열 예측 모델 간접 호출을 테스트하는 방법에 대한 전체 예는 Time-Series Forecasting with Amazon SageMaker Autopilot을 참조하세요.

import boto3 import pandas as pd csv_path = './real-time-payload.csv' data = pd.read_csv(csv_path) client = boto3.client("runtime.sagemaker") body = data.to_csv(index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

다음 예시에서는 시계열 예측 모델을 간접 호출하는 방법을 보여줍니다. 시계열 예측 모델 간접 호출을 테스트하는 방법에 대한 전체 예는 Time-Series Forecasting with Amazon SageMaker Autopilot을 참조하세요.

import boto3 import pandas as pd csv_path = './real-time-payload.csv' data = pd.read_csv(csv_path) client = boto3.client("runtime.sagemaker") body = data.to_csv(index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

다음 예시에서는 이미지 예측 모델을 호출하는 방법을 보여줍니다.

import boto3 client = boto3.client("runtime.sagemaker") with open("example_image.jpg", "rb") as file: body = file.read() response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="application/x-image", Body=body, Accept="application/json" )

다음 예시에서는 이미지 예측 모델을 호출하는 방법을 보여줍니다.

import boto3 client = boto3.client("runtime.sagemaker") with open("example_image.jpg", "rb") as file: body = file.read() response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="application/x-image", Body=body, Accept="application/json" )

다음 예시에서는 텍스트 예측 모델을 호출하는 방법을 보여줍니다.

import boto3 import pandas as pd client = boto3.client("runtime.sagemaker") body = pd.DataFrame([["Example text 1"], ["Example text 2"]]).to_csv(header=False, index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )

다음 예시에서는 텍스트 예측 모델을 호출하는 방법을 보여줍니다.

import boto3 import pandas as pd client = boto3.client("runtime.sagemaker") body = pd.DataFrame([["Example text 1"], ["Example text 2"]]).to_csv(header=False, index=False).encode("utf-8") response = client.invoke_endpoint( EndpointName="endpoint_name", ContentType="text/csv", Body=body, Accept="application/json" )
프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.