unslothai/unsloth · error · HTTPException

dataset_name must be a Hugging Face repo id like org/repo

Error message

dataset_name must be a Hugging Face repo id like org/repo

What it means

HTTP 400 raised at the top of POST /seed/inspect when payload.dataset_name, after stripping, is empty or contains no '/' character. Hugging Face dataset repo ids have the form org/repo (or user/dataset), so a slash is the minimal structural check before the datasets library is loaded.

Source

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

    for fid, fname in zip(file_ids, file_names):
        extracted = block_dir / f"{fid}.extracted.txt"
        if not extracted.exists():
            raise HTTPException(404, f"Extracted text not found for file: {fname} (id: {fid})")
        file_entries.append((extracted, fname))

    return build_multi_file_preview_rows(
        file_entries = file_entries,
        preview_size = preview_size,
        chunk_size = chunk_size,
        chunk_overlap = chunk_overlap,
    )


@router.post("/seed/inspect", response_model = SeedInspectResponse)
def inspect_seed_dataset(payload: SeedInspectRequest) -> SeedInspectResponse:
    dataset_name = payload.dataset_name.strip()
    if not dataset_name or dataset_name.count("/") < 1:
        raise HTTPException(
            status_code = 400,
            detail = "dataset_name must be a Hugging Face repo id like org/repo",
        )

    try:
        from datasets import load_dataset
    except ImportError as exc:
        raise log_and_http_error(
            exc,
            500,
            "seed inspect dependencies unavailable",
            event = "data_recipe.seed.dependencies_unavailable",
            log = logger,
        ) from exc

    split = _normalize_optional_text(payload.split) or DEFAULT_SPLIT
    subset = _normalize_optional_text(payload.subset)
    token = _normalize_optional_text(payload.hf_token)

View on GitHub (pinned to 203007d190)

Solutions

  1. Use the full repo id shown on the dataset page: org/repo (e.g. 'gretelai/synthetic-gsm8k-reflection').
  2. If the dataset has no org (rare, user namespaces are standard), find its owner and prefix it.
  3. Strip URLs client-side: take the last two path segments from an HF link.

Example fix

// before
inspect({ dataset_name: 'fashion_mnist' })

// after
inspect({ dataset_name: 'zalando-datasets/fashion_mnist' })
Defensive patterns

Strategy: validation

Validate before calling

function normalizeHfRepoId(input) {
  const v = input.trim();
  if (v.startsWith('http')) {
    const parts = v.replace(/\/$/, '').split('/');
    return parts.slice(-2).join('/'); // org/repo from URL
  }
  return v;
}
const name = normalizeHfRepoId(userInput);
if (!/^[^/\s]+\/[^/\s]+$/.test(name)) throw new Error('use org/repo form');

Type guard

function isHfRepoId(s: string): boolean {
  return /^[\w.-]+\/[\w.-]+$/.test(s.trim());
}

Try / catch

On 400, show the user the expected org/repo format with a link to the dataset page; never retry unmodified input.

Prevention

When it happens

Trigger: POST /seed/inspect with dataset_name like 'wikitext' (no org), '' after trim, a display name like 'WikiText', or a URL such as 'https://huggingface.co/datasets/org/repo' (slash present but not a repo id — passes this check but fails later).

Common situations: User types the bare dataset name from a blog post; frontend passes the dataset label instead of the id; copy/paste includes the full HF URL.

Related errors


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