unslothai/unsloth · error · HTTPException

dataset appears empty or unreadable

Error message

dataset appears empty or unreadable

What it means

HTTP 422 raised near the end of POST /seed/inspect when preview_rows is empty after all preview paths ran — the dataset resolved and loaded but yielded zero rows for the requested split/subset/data_files combination, or rows could not be read into records.

Source

Thrown at studio/backend/routes/data_recipe/seed.py:379

                subset = subset,
                token = token,
            )
            preview_rows = _load_preview_rows(
                load_dataset_fn = load_dataset,
                load_kwargs = split_kwargs,
                preview_size = preview_size,
            )
        except (ValueError, OSError, RuntimeError) as exc:
            raise log_and_http_error(
                exc,
                422,
                "seed inspect failed",
                event = "data_recipe.seed.hf_preview_failed",
                log = logger,
            ) from exc

    if not preview_rows:
        raise HTTPException(status_code = 422, detail = "dataset appears empty or unreadable")
    preview_rows = _serialize_preview_rows(preview_rows)
    columns = _extract_columns(preview_rows)

    if not data_files:
        resolved_path = f"datasets/{dataset_name}/**/*.parquet"
    else:
        resolved_path = _resolve_seed_hf_path(dataset_name, data_files, split)
        if not resolved_path:
            raise HTTPException(status_code = 422, detail = "unable to resolve seed dataset path")

    return SeedInspectResponse(
        dataset_name = dataset_name,
        resolved_path = resolved_path,
        columns = columns,
        preview_rows = preview_rows,
        split = split,
        subset = subset,
    )

View on GitHub (pinned to 203007d190)

Solutions

  1. Check the dataset card on Hugging Face for the actual split and config names and retry with those exact values.
  2. Retry without data_files/subset filters to confirm the dataset has data at all.
  3. If the split is genuinely tiny/empty, pick another split for the preview.

Example fix

# before
inspect(dataset_name='org/repo', split='val')

# after
inspect(dataset_name='org/repo', split='validation')  # name from dataset card
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check splits/subsets via the HF datasets-server API before inspect
const info = await fetch(`https://datasets-server.huggingface.co/splits?dataset=${encodeURIComponent(name)}`).then(r => r.json());
const okSplit = info.splits?.some(s => s.config === subset && s.split === split);
if (!okSplit) throw new Error(`split '${split}' not available; check ${name} splits`);

Try / catch

On 422 'dataset appears empty or unreadable', re-query the dataset's available splits and prompt the user to choose one; do not retry the same split.

Prevention

When it happens

Trigger: POST /seed/inspect with a split that does not exist or is empty (e.g. split='validation' on a train-only dataset), a subset/config name mismatch, or data_files glob matching only empty files.

Common situations: Dataset's split naming differs from expectation ('test' vs 'eval', 'train_small'); gated/empty dataset revision; user guesses subset names; non-tabular data where row extraction returns nothing.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/2eca13fb7f73e632. Report an issue: GitHub.