DeserializerWrapper
prevents the use of valid input Content-Types during inference - SageMaker endpoitns build with ModelBuilder and SchemaBuilder
#5006
Labels
Describe the bug
DeserializerWrapper
overwrites thecontent_type
provided todeserialize()
to be the value ofAccept
. ThisDeserializerWrapper
is used for both Input and Output de-serialization when usingSchemaBuilder
. The comments mention:but this effectively prevents endpoints deployed through the use of
ModelBuilder
andSchemaBuilder
to support additionalContent-Types
, despite the various implementations ofBaseDeserializer
supporting multiple Content-Types.For example, an inference endpoint deployed via
ModelBuilder
andSchemaBuilder
which takes anp.array
as input cannot be invoked with aContent-Type
such asapplication/json
ortext/csv
due to this overwriting. This also makes the developer experience confusing as the stack trace shows the execution path forapplication/x-npy
Content-Type, despite a different Content-Type being explicitly provided.To reproduce
Expected behavior
I would like the
content_type
to not be overwritten for input de-serialization, so that I can useSchemaBuilder
for inference endpoints while providing a Content-Type other thanapplication/x-npy
, such asapplication/json
via CURL.Screenshots or logs
System information
A description of your system. Please provide:
Additional context
model.deploy()
returns an instance ofPredictor
, which does work properly. However, this limits inference to Python clients who have created aPredictor
instance. Clients in other languages are unable to invoke the inference server, for example.Workarounds may be possible by implementing
CustomPayloadTranslator
and providing it viainput_translator
, but I have not yet tested this.The text was updated successfully, but these errors were encountered: