Batch predictions Vertext AI

How do I create JSONL file which contains list of files in Google Cloud Bucket for Batch prediction in Vertex AI?
What I’ve tried so far.

  1. Get list of file from bucket and write it to a txt file
    gsutil ls gs://bucket/dir > list.txt
  2. Convert list.txt to list.jsonl following Vertext AI docs:
{"content": "gs://sourcebucket/datasets/images/source_image1.jpg", "mimeType": "image/jpeg"},
{"content": "gs://sourcebucket/datasets/images/source_image2.jpg", "mimeType": "image/jpeg"}

After create batch prediction, I got this error: cannot be parsed as JSONL.
How do I correct the format of this JSONL file?
Also, is there anyway to directly export list files in bucket to JSONL file format?

Source: Python Questions

LEAVE A COMMENT