{"record":{"id":"d9bcb21337f2bea1","repo":"unslothai/unsloth","slug":"unknown-or-unsupported-format-fmt","errorCode":null,"errorMessage":"Unknown or unsupported format: '{fmt}'","messagePattern":"Unknown or unsupported format: '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/datasets/dataset_none_detect.py","lineNumber":565,"sourceCode":"    conv_info = _probe_conversation(dataset)\n    if was_auto:\n        fmt = \"unknown\"\n        for entry in FORMAT_REGISTRY:\n            if entry[\"match\"](dataset, conv_info):\n                fmt = entry[\"name\"]\n                break\n        # No format matched: return clean stats (format=\"unknown\") instead of\n        # raising, so callers can branch on stats[\"format\"].\n        if fmt == \"unknown\":\n            return {\n                \"format\": \"unknown\",\n                \"total_rows\": len(dataset),\n                \"findings\": [],\n                \"bad_row_indices\": [],\n            }\n    scanner = get_scanner(fmt)\n    if scanner is None:\n        raise ValueError(f\"Unknown or unsupported format: '{fmt}'\")\n    # Column forwarding: on auto-detect pass the probed column (the best\n    # choice). On an explicit format let that scanner pick its own column, so\n    # e.g. fmt='sharegpt' always scans 'conversations', not 'messages' (P1 fix);\n    # gptoss has its own messages-first rule. alpaca never takes a column.\n    use_probed_col = conv_info is not None and fmt != \"alpaca\" and was_auto\n    if use_probed_col:\n        stats = scanner(dataset, col = conv_info[\"column\"])\n    else:\n        stats = scanner(dataset)\n    stats[\"format\"] = fmt\n    return stats\n\n\n# ---------------------------------------------------------------------------\n# Report printing\n# ---------------------------------------------------------------------------\n\n","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/datasets/dataset_none_detect.py#L547-L583","documentation":"ValueError from scan_dataset when the requested format (after FORMAT_ALIASES normalization) has no registered scanner. The format registry maps names like chatml/sharegpt/gptoss/alpaca to find_none_* scanners; auto-detection never raises this (unknown data returns clean stats with format='unknown'), so it always means an explicit fmt string was mis-typed or unsupported.","triggerScenarios":"scan_dataset(ds, fmt='chatm') (typo), fmt='dialogue' (invented name), or an alias missing from FORMAT_ALIASES in this version. Note fmt='auto'/'unknown' bypass the raise.","commonSituations":"User-supplied format strings from CLI flags or UI dropdowns forwarded without validation; version skew where a format alias was added/renamed; mixing up trainer format names with scanner format names.","solutions":["Use a supported format name: 'auto', or one of the registered scanners (chatml, sharegpt, gptoss, alpaca — check FORMAT_ALIASES/get_scanner for the exact set in your version)","Prefer fmt='auto' unless you specifically need to force a scanner — auto-detect never raises this error","Validate fmt against the registry at the CLI/API boundary: get_scanner(fmt) is None -> reject early"],"exampleFix":"# before\nstats = scan_dataset(ds, fmt='chatml-v2')  # unsupported name\n\n# after\nstats = scan_dataset(ds, fmt='auto')\n# or explicit supported name:\nstats = scan_dataset(ds, fmt='chatml')","handlingStrategy":"validation","validationCode":"from studio.backend.utils.datasets.dataset_none_detect import get_scanner, FORMAT_ALIASES\n\ndef is_supported_fmt(fmt: str) -> bool:\n    return get_scanner(FORMAT_ALIASES.get(fmt, fmt)) is not None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate fmt via get_scanner() before calling scan_dataset with an explicit format","Default to fmt='auto' — auto-detection degrades gracefully instead of raising","Restrict CLI/UI format options to the registry keys of the version you run"],"tags":["datasets","validation","format-detection","data-quality"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}