기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
비동기 엔드포인트 간접 호출
InvokeEndpointAsync
를 사용하여 비동기 엔드포인트에 호스팅된 모델에서 추론을 가져옵니다.
참고
아직 업로드하지 않았다면 추론 데이터(예: 기계 학습 모델, 샘플 데이터)를 Amazon S3에 업로드하세요.
요청에 다음 필드를 지정하세요.
InputLocation
의 경우, 추론 데이터의 위치를 지정하세요.EndpointName
의 경우, 엔드포인트 이름을 지정하세요.(선택 사항)
InvocationTimeoutSeconds
의 경우 요청의 최대 제한 시간을 설정할 수 있습니다. 요청마다 이 값을 최대 3,600초(1시간)로 설정할 수 있습니다. 요청에 이 필드를 지정하지 않으면 요청 제한 시간이 기본적으로 15분이 됩니다.
# Create a low-level client representing Amazon SageMaker Runtime sagemaker_runtime = boto3.client("sagemaker-runtime", region_name=
<aws_region>
) # Specify the location of the input. Here, a single SVM sample input_location ="s3://bucket-name/test_point_0.libsvm"
# The name of the endpoint. The name must be unique within an AWS Region in your AWS account. endpoint_name='<endpoint-name>'
# After you deploy a model into production using SageMaker AI hosting # services, your client applications use this API to get inferences # from the model hosted at the specified endpoint. response = sagemaker_runtime.invoke_endpoint_async( EndpointName=endpoint_name, InputLocation=input_location, InvocationTimeoutSeconds=3600)
요청 ID와 처리 후 API 직접 호출에 대한 응답을 받을 Amazon S3 버킷의 이름이 포함된 JSON 문자열로 응답을 받습니다.