{"record":{"id":"1f8a1e86c7541757","repo":"unslothai/unsloth","slug":"dataset-name-must-be-a-hugging-face-repo-id-like-o","errorCode":null,"errorMessage":"dataset_name must be a Hugging Face repo id like org/repo","messagePattern":"dataset_name must be a Hugging Face repo id like org/repo","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"studio/backend/routes/data_recipe/seed.py","lineNumber":314,"sourceCode":"    for fid, fname in zip(file_ids, file_names):\n        extracted = block_dir / f\"{fid}.extracted.txt\"\n        if not extracted.exists():\n            raise HTTPException(404, f\"Extracted text not found for file: {fname} (id: {fid})\")\n        file_entries.append((extracted, fname))\n\n    return build_multi_file_preview_rows(\n        file_entries = file_entries,\n        preview_size = preview_size,\n        chunk_size = chunk_size,\n        chunk_overlap = chunk_overlap,\n    )\n\n\n@router.post(\"/seed/inspect\", response_model = SeedInspectResponse)\ndef inspect_seed_dataset(payload: SeedInspectRequest) -> SeedInspectResponse:\n    dataset_name = payload.dataset_name.strip()\n    if not dataset_name or dataset_name.count(\"/\") < 1:\n        raise HTTPException(\n            status_code = 400,\n            detail = \"dataset_name must be a Hugging Face repo id like org/repo\",\n        )\n\n    try:\n        from datasets import load_dataset\n    except ImportError as exc:\n        raise log_and_http_error(\n            exc,\n            500,\n            \"seed inspect dependencies unavailable\",\n            event = \"data_recipe.seed.dependencies_unavailable\",\n            log = logger,\n        ) from exc\n\n    split = _normalize_optional_text(payload.split) or DEFAULT_SPLIT\n    subset = _normalize_optional_text(payload.subset)\n    token = _normalize_optional_text(payload.hf_token)","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/data_recipe/seed.py#L296-L332","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Use the full repo id shown on the dataset page: org/repo (e.g. 'gretelai/synthetic-gsm8k-reflection').","If the dataset has no org (rare, user namespaces are standard), find its owner and prefix it.","Strip URLs client-side: take the last two path segments from an HF link."],"exampleFix":"// before\ninspect({ dataset_name: 'fashion_mnist' })\n\n// after\ninspect({ dataset_name: 'zalando-datasets/fashion_mnist' })","handlingStrategy":"validation","validationCode":"function normalizeHfRepoId(input) {\n  const v = input.trim();\n  if (v.startsWith('http')) {\n    const parts = v.replace(/\\/$/, '').split('/');\n    return parts.slice(-2).join('/'); // org/repo from URL\n  }\n  return v;\n}\nconst name = normalizeHfRepoId(userInput);\nif (!/^[^/\\s]+\\/[^/\\s]+$/.test(name)) throw new Error('use org/repo form');","typeGuard":"function isHfRepoId(s: string): boolean {\n  return /^[\\w.-]+\\/[\\w.-]+$/.test(s.trim());\n}","tryCatchPattern":"On 400, show the user the expected org/repo format with a link to the dataset page; never retry unmodified input.","preventionTips":["Autocomplete dataset names from the HF API so users pick valid ids.","Normalize pasted URLs to org/repo client-side."],"tags":["huggingface","validation","http-400","dataset"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}