sagemaker.serve.async_inference.async_inference_response

sagemaker.serve.async_inference.async_inference_response#

A class for AsyncInferenceResponse

Classes

AsyncInferenceResponse(predictor_async, ...)

Response from Async Inference endpoint

class sagemaker.serve.async_inference.async_inference_response.AsyncInferenceResponse(predictor_async, output_path, failure_path)[source]#

Bases: object

Response from Async Inference endpoint

This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result

get_result(waiter_config=None)[source]#

Get async inference result in the Amazon S3 output path specified

Parameters:

waiter_config (sagemaker.async_inference.waiter_config.WaiterConfig) – Configuration for the waiter. The pre-defined value for the delay between poll is 15 seconds and the default max attempts is 60

Raises:

ValueError – If a wrong type of object is provided as waiter_config

Returns:

Inference result in the given Amazon S3 output path. If a deserializer was

specified when creating the AsyncPredictor, the result of the deserializer is returned. Otherwise the response returns the sequence of bytes as is.

Return type:

object