sagemaker-inference-toolkit
sagemaker-inference-toolkit copied to clipboard
Request encoding function for application/jsonlines output format
Is your feature request related to a problem? Please describe.
When I call encoder.encode(prediction, accept='application/jsonlines')
with prediction
a list of json
, it generates an error.
Describe the solution you'd like
Hope the returned a output file with json records arranged by lines, i.e.:
{'key': value, ...}
{'key': value, ...}
...
Describe alternatives you've considered If the above request has been solved, please give the document souce. Thanks.
When I call
encoder.encode(prediction, accept='application/jsonlines')
withprediction
a list ofjson
, it generates an error.
@BaoshengHeTR, can you please provide the error, stack trace, and any other relevant logs related to this error? Please also provide relevant system information as listed in the bug report issue template.
When I call
encoder.encode(prediction, accept='application/jsonlines')
withprediction
a list ofjson
, it generates an error.@BaoshengHeTR, can you please provide the error, stack trace, and any other relevant logs related to this error? Please also provide relevant system information as listed in the bug report issue template.
can you show me an application of inference-tookit using application/lines
as output accept output format?
@BaoshengHeTR For the inference toolkit, the encoder.encode
method here will raise an UnsupportedFormatError
if the content_type
is not found in the encoder map. The specific string values of the constants in the encoder map can be found here.
Is an UnsupportedFormatError
what you are experiencing? Could you provide details regarding the particular error you are facing (as listed in the bug report issue template)?
here
Thanks. The problem is because my type is application/jsonlines
rather than application/json
. I managed to solve my problem in another way.
@BaoshengHeTR
Thanks again for contacting us. Let us know if there's anything else we can help with.
Best regards.