kyagu
kyagu

Reputation: 183

how to structure input/formats for batch inference in sagemaker?

example provided in the aws documentation , https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html, states that the input csv can be structured like a sample below. I noticed for batch jobs in sagemaker, it can accept json as well. how to structure the json, does each record need to in a single line as shown in a csv example or can it be multiline?

Record1-Attribute1, Record1-Attribute2, Record1-Attribute3, ..., Record1-AttributeM
...

Upvotes: 0

Views: 1082

Answers (1)

Marc Karp
Marc Karp

Reputation: 1314

It is recommended to make use of JSON Lines (i.e. each JSON to be on a single line). You can then set BatchStrategy to MultiRecord and SplitType to Line. Batch Transform can then fit as many records in a mini-batch within the MaxPayloadInMB limit.

Kindly see the CreateTransformJob API for more information.

Upvotes: 1

Related Questions