{"record":{"id":"6ad520c2b9307194","repo":"unslothai/unsloth","slug":"split-name-is-too-long-max-max-hf-dataset-option","errorCode":null,"errorMessage":"split name is too long (max {MAX_HF_DATASET_OPTION_LENGTH} chars)","messagePattern":"split name is too long \\(max (.+?) chars\\)","errorType":"validation","errorClass":"ValueError","httpStatus":422,"severity":"error","filePath":"studio/backend/models/training.py","lineNumber":284,"sourceCode":"            return None\n        if len(v) > 4096:\n            raise ValueError(\"local cache path is too long (max 4096 chars)\")\n        if \"\\x00\" in v:\n            raise ValueError(\"local cache path contains invalid characters\")\n        if \"..\" in Path(v).parts or \"..\" in PureWindowsPath(v).parts:\n            raise ValueError(\"local cache path must not contain '..' segments\")\n        return v\n\n    @field_validator(\"train_split\", \"eval_split\")\n    @classmethod\n    def _check_split_name(cls, v: Optional[str]) -> Optional[str]:\n        if v is None:\n            return v\n        v = v.strip()\n        if not v:\n            return None\n        if len(v) > MAX_HF_DATASET_OPTION_LENGTH:\n            raise ValueError(f\"split name is too long (max {MAX_HF_DATASET_OPTION_LENGTH} chars)\")\n        if not valid_hf_dataset_split_instruction(v):\n            raise ValueError(\"split name contains invalid characters\")\n        return v\n\n    @field_validator(\"learning_rate\", mode = \"before\")\n    @classmethod\n    def _check_learning_rate(cls, v):\n        # Stringify because downstream call sites float() it themselves.\n        lr = _parse_lr(v)\n        return str(lr)\n\n    @field_validator(\"batch_size\")\n    @classmethod\n    def _check_batch_size(cls, v: int) -> int:\n        if v is None:\n            raise ValueError(\"batch_size is required\")\n        if v < 1 or v > _MAX_BATCH_SIZE:\n            raise ValueError(f\"batch_size must be in [1, {_MAX_BATCH_SIZE}] (got {v!r})\")","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/models/training.py#L266-L302","documentation":"Raised by the _check_split_name field validator shared by train_split and eval_split: after trimming (empty normalizes to None), a split name longer than MAX_HF_DATASET_OPTION_LENGTH characters is rejected. Split names are short identifiers like 'train', 'test', 'train[:80%]', so an over-long value means the wrong data landed in the field. The length check fires before the character-validity check.","triggerScenarios":"POST a training start request with train_split or eval_split longer than the configured max, e.g. an entire split-instruction script or a pasted error message in the field.","commonSituations":"UI free-text areas bound to split fields; users pasting documentation snippets; config systems that inline a list of splits into one field.","solutions":["Use a short split name or HF slice instruction, e.g. 'train' or 'train[:80%]'.","Check field mapping in the request builder — long content belongs elsewhere.","Omit eval_split if you do not want an eval phase (it normalizes to None)."],"exampleFix":"// before\n{ train_split: \"train,validation,test combined and shuffled\" }\n// after\n{ train_split: \"train[:80%]\", eval_split: \"train[80%:]\" }","handlingStrategy":"validation","validationCode":"def split_names_short_enough(body: dict, max_len: int) -> bool:\n    return all(len((body.get(f) or \"\").strip()) <= max_len for f in (\"train_split\", \"eval_split\"))","typeGuard":"function splitsOk(body: { train_split?: string; eval_split?: string }, maxLen: number): boolean {\n  return [body.train_split, body.eval_split].every(s => (s?.trim().length ?? 0) <= maxLen);\n}","tryCatchPattern":null,"preventionTips":["Use short split names or HF slice syntax ('train[:80%]')","Omit eval_split when no eval phase is wanted","Do not inline lists of splits into one field"],"tags":["pydantic","validation","training","huggingface","dataset-split"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}