sagemaker.serve.builder.schema_builder#
Placeholder docstring
Classes
|
Wraps the CSVSerializer because it does not convert dataframe to bytes |
|
Wraps the deserializer to comply with the function signature. |
|
Wraps the JSONSerializer because it does not convert jsonable to bytes |
|
Automatically detects the serializer and deserializer for your model. |
- class sagemaker.serve.builder.schema_builder.CSVSerializerWrapper(content_type='text/csv')[source]#
Bases:
CSVSerializerWraps the CSVSerializer because it does not convert dataframe to bytes
- class sagemaker.serve.builder.schema_builder.DeserializerWrapper(deserializer, accept)[source]#
Bases:
BaseDeserializerWraps the deserializer to comply with the function signature.
- property ACCEPT#
Placeholder docstring
- class sagemaker.serve.builder.schema_builder.JSONSerializerWrapper(content_type='application/json')[source]#
Bases:
JSONSerializerWraps the JSONSerializer because it does not convert jsonable to bytes
- class sagemaker.serve.builder.schema_builder.SchemaBuilder(sample_input, sample_output, input_translator: CustomPayloadTranslator | None = None, output_translator: CustomPayloadTranslator | None = None)[source]#
Bases:
TritonSchemaBuilderAutomatically detects the serializer and deserializer for your model.
This is done by inspecting the sample_input and sample_output object. Alternatively, provide your custom serializer and deserializer for your request or response by creating a class that inherits
CustomPayloadTranslatorand provide it toSchemaBuilder.- Parameters:
sample_input (object) – Sample input to the model which can be used for testing. The schema builder internally generates the content type and corresponding serializing functions.
sample_output (object) – Sample output to the model which can be used for testing. The schema builder internally generates the accept type and corresponding serializing functions.
input_translator (Optional[CustomPayloadTranslator]) – If you want to define your own serialization method for the payload, you can implement your functions for translation.
output_translator (Optional[CustomPayloadTranslator]) – If you want to define your own serialization method for the output, you can implement your functions for translation.