Skip to main content
A dataset is a JSONL file, one sample a line. The sample format is in Data; images and videos are in Images and videos. An organisation keeps up to 50 datasets, 10 GB a file.

The dataset object

Upload a file

Three requests: reserve the upload, send the file, ask for the check.
1

Reserve

POST /v1/datasets with the file’s name and its size in bytes.
The answer is the dataset in uploading, with where to send the file:
A large file gets part_urls instead (a multipart upload, then complete); the SDK handles it.
2

Send the file

One PUT of the file to upload_url, with the upload_headers. No Authorization header on this one.
3

Complete

POST /v1/datasets/{id}/complete starts the server’s check and returns the dataset in checking.
4

Wait for the check

Poll GET /v1/datasets/{id} until state is ready or invalid. A small file takes a few seconds.
The SDK and the command line do all four, after checking the format locally:
"images": true means the upload is a bundle: a tar of the samples and the image and video files they name, as the SDK writes it. Use the SDK or the command line for those.

Import from Hugging Face

POST /v1/datasets/huggingface/splits lists a dataset’s splits; POST /v1/datasets/huggingface imports one. The split must already be in an accepted format. A gated or private dataset needs hf_token.
The splits:
The import returns the dataset in importing; it goes on to checking, then ready or invalid.

List and read

GET /v1/datasets returns your datasets and the sample datasets as a list; GET /v1/datasets/{id} returns one.

The batch a job would train with

GET /v1/datasets/{id}/plan?model=... says how a model would step through the dataset. Query parameters: model (required), layout, max_seq_len, batch_size, tokens_per_gpu, gradient_accumulation_steps, train_type.
The main fields of the answer:
batch is the samples a step takes and steps_per_epoch what that gives. This dataset is smaller than one step, so an epoch is one step; see Small datasets. The answer is 409 for an estimated dataset before the model’s first job.

Download and delete