{"record":{"id":"6f2399278b4f9eff","repo":"unslothai/unsloth","slug":"no-valid-conversation-column-found-in-dataset-col-6f2399","errorCode":null,"errorMessage":"No valid conversation column found in {dataset.column_names}. Expected a 'messages' or 'conversations' column with 'role'/'content' turn keys.","messagePattern":"No valid conversation column found in (.+?)\\. Expected a 'messages' or 'conversations' column with 'role'/'content' turn keys\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/datasets/dataset_none_detect.py","lineNumber":408,"sourceCode":"            raise ValueError(\n                f\"No valid conversation column found in {dataset.column_names}. \"\n                \"Expected a 'conversations' column with 'from'/'value' or 'role'/'content' turn keys.\"\n            )\n        col = conv_info[\"column\"]\n    return find_none_chatml(dataset, col = col)\n\n\ndef find_none_gptoss(dataset: Dataset, col: str = None) -> dict:\n    \"\"\"gptoss: role/content plus optional thinking/tool_calls. Only content checked.\"\"\"\n    if col is None:\n        # gptoss lives in 'messages': target it whenever present (even if\n        # corrupt); fall back to 'conversations' only if 'messages' is absent.\n        if \"messages\" in dataset.column_names:\n            conv_info = _probe_conversation(dataset, candidates = (\"messages\",))\n        else:\n            conv_info = _probe_conversation(dataset, candidates = (\"conversations\",))\n        if conv_info is None:\n            raise ValueError(\n                f\"No valid conversation column found in {dataset.column_names}. \"\n                \"Expected a 'messages' or 'conversations' column with 'role'/'content' turn keys.\"\n            )\n        col = conv_info[\"column\"]\n    return find_none_chatml(dataset, col = col)\n\n\n# ---------------------------------------------------------------------------\n# Format registry - first match wins; detect_format() auto-scales.\n# Each entry: name (label/--format value), match(dataset, conv_info) -> bool,\n# scan (find_none_* function). Put specific formats before general ones\n# (gptoss before chatml, since gptoss is chatml with a 'developer' role).\n# To add a format: write find_none_<name>() (or reuse find_none_chatml) and\n# append an entry; detect_format(), --format, and scan_dataset() pick it up.\n# ---------------------------------------------------------------------------\n\nFORMAT_REGISTRY = [\n    {","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/datasets/dataset_none_detect.py#L390-L426","documentation":"ValueError from find_none_gptoss when column auto-detection fails. gptoss targets 'messages' whenever present (even if corrupt, so corruption is reported rather than dodged) and only falls back to 'conversations' when 'messages' is absent; the error means neither probe produced a column whose turns have valid role/content keys.","triggerScenarios":"Calling find_none_gptoss(dataset) on a dataset with no 'messages' and no valid 'conversations' column, or where the 'messages' turns use non-role/content keys (e.g. {'from','value'} ShareGPT turns — invalid for the gptoss probe) or are not dicts.","commonSituations":"gpt-oss format expectations applied to a ShareGPT dataset; messages column of raw strings or nulls; schemas where the turn payload sits under a nested key so the probe never sees role/content.","solutions":["If the data is ShareGPT ('from'/'value'), scan with fmt='sharegpt' instead","Ensure a 'messages' column exists whose turns are dicts with 'role' and 'content' keys, then retry","Pass the column explicitly when it exists under another name and has valid role/content turns: find_none_gptoss(dataset, col='...')"],"exampleFix":"# before\nstats = find_none_gptoss(dataset)  # turns are {'from','value'} ShareGPT\n\n# after\nstats = find_none_sharegpt(dataset)  # correct scanner for from/value turns\n# or standardize first:\n# dataset = standardize_chat_format(dataset, ..., chat_column='conversations')","handlingStrategy":"validation","validationCode":"def is_gptoss_scannable(dataset) -> bool:\n    col = \"messages\" if \"messages\" in dataset.column_names else \"conversations\"\n    if col not in dataset.column_names:\n        return False\n    sample = next(iter(dataset), None)\n    turns = (sample or {}).get(col) or []\n    return bool(turns) and isinstance(turns[0], dict) and {\"role\", \"content\"} <= turns[0].keys()","typeGuard":"def is_role_content_turn(turn) -> bool:\n    return isinstance(turn, dict) and \"role\" in turn and \"content\" in turn","tryCatchPattern":null,"preventionTips":["gptoss requires role/content turns — from/value ShareGPT data should use fmt='sharegpt'","Verify 'messages' exists and its turns are dicts with role/content before scanning","Don't assume format from the model name; probe one turn's keys first"],"tags":["datasets","data-quality","gptoss","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}