unslothai/unsloth · error · HTTPException

unable to resolve seed dataset path

Error message

unable to resolve seed dataset path

What it means

HTTP 422 raised in POST /seed/inspect when data_files were supplied but _resolve_seed_hf_path(dataset_name, data_files, split) could not map them to a concrete path pattern. The resolved path (e.g. datasets/{name}/**/*.parquet or a specific file glob) is what downstream recipe execution reads, so an unresolvable mapping aborts the inspect.

Solutions

  1. List the repo files on huggingface.co (Files tab) and pass exact, current data_files paths.
  2. Drop data_files and let the default 'datasets/{name}/**/*.parquet' resolution apply.
  3. Verify the split argument matches the split directories embedded in the file paths.

Example fix

# before
inspect(dataset_name='org/repo', split='train', data_files=['data/train-0001-of-0002.parquet'])

# after
inspect(dataset_name='org/repo', split='train', data_files=['data/train-00000-of-00002.parquet'])  # exact current filename
Defensive patterns

Strategy: validation

Validate before calling

// Verify data_files exist in the repo before inspect
const tree = await fetch(`https://huggingface.co/api/datasets/${encodeURIComponent(name)}/tree/main`).then(r => r.json());
const paths = new Set(tree.map(f => f.path));
const missing = dataFiles.filter(f => !paths.has(f));
if (missing.length) throw new Error(`not in repo: ${missing.join(', ')}`);

Try / catch

On 422 'unable to resolve seed dataset path', fall back to calling inspect without data_files; if that succeeds, the file list was wrong — refresh it from the repo.

Prevention

When it happens

Trigger: POST /seed/inspect with data_files entries whose names do not exist in the repo, or whose layout does not let the resolver correlate data_files + split to a repo path (wrong split segment, renamed files, case mismatch).

Common situations: User copies data_files names from an older dataset revision; repo restructured (files moved/m renamed); split name embedded in the file path differs from the split argument.

Related errors


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

Appendix: source

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

            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,
    )


def _extract_text_from_file(file_path: Path, ext: str) -> str:
    """Extract text from an uploaded file by extension, to markdown where possible."""
    if ext in {".txt", ".md"}:
        raw = file_path.read_text(encoding = "utf-8", errors = "ignore")
    elif ext == ".pdf":
        import pymupdf4llm
        raw = pymupdf4llm.to_markdown(

View on GitHub (pinned to 203007d190)