sagemaker.serve.marshalling.custom_payload_translator#
Defines CustomPayloadTranslator class that holds custom serialization/deserialization code
Classes
|
Abstract base class for handling custom payload serialization and deserialization. |
- class sagemaker.serve.marshalling.custom_payload_translator.CustomPayloadTranslator(content_type: str = 'application/custom', accept_type: str = 'application/custom')[source]#
Bases:
ABCAbstract base class for handling custom payload serialization and deserialization.
Provides a skeleton for customization requiring the overriding of the serialize_payload and deserialize_payload methods.
- Parameters:
content_type (str) – The content type of the endpoint input data.
accept_type (str) – The content type of the data accepted from the endpoint.
- property ACCEPT#
Placeholder docstring
- property CONTENT_TYPE#
Placeholder docstring
- deserialize(stream: IO, content_type: str = 'application/custom') object[source]#
Placeholder docstring
- abstract deserialize_payload_from_stream(stream: IO) object[source]#
Deserialize stream into object.
- Parameters:
stream (IO) – Stream of bytes
- Returns:
Deserialized data
- Return type:
object