unslothai/unsloth · error · ValueError

No valid conversation column found in {dataset.column_names}

Error message

No valid conversation column found in {dataset.column_names}. Expected a 'messages' or 'conversations' column with 'role'/'content' turn keys.

What it means

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.

Source

Thrown at studio/backend/utils/datasets/dataset_none_detect.py:408

            raise ValueError(
                f"No valid conversation column found in {dataset.column_names}. "
                "Expected a 'conversations' column with 'from'/'value' or 'role'/'content' turn keys."
            )
        col = conv_info["column"]
    return find_none_chatml(dataset, col = col)


def find_none_gptoss(dataset: Dataset, col: str = None) -> dict:
    """gptoss: role/content plus optional thinking/tool_calls. Only content checked."""
    if col is None:
        # gptoss lives in 'messages': target it whenever present (even if
        # corrupt); fall back to 'conversations' only if 'messages' is absent.
        if "messages" in dataset.column_names:
            conv_info = _probe_conversation(dataset, candidates = ("messages",))
        else:
            conv_info = _probe_conversation(dataset, candidates = ("conversations",))
        if conv_info is None:
            raise ValueError(
                f"No valid conversation column found in {dataset.column_names}. "
                "Expected a 'messages' or 'conversations' column with 'role'/'content' turn keys."
            )
        col = conv_info["column"]
    return find_none_chatml(dataset, col = col)


# ---------------------------------------------------------------------------
# Format registry - first match wins; detect_format() auto-scales.
# Each entry: name (label/--format value), match(dataset, conv_info) -> bool,
# scan (find_none_* function). Put specific formats before general ones
# (gptoss before chatml, since gptoss is chatml with a 'developer' role).
# To add a format: write find_none_<name>() (or reuse find_none_chatml) and
# append an entry; detect_format(), --format, and scan_dataset() pick it up.
# ---------------------------------------------------------------------------

FORMAT_REGISTRY = [
    {

View on GitHub (pinned to 203007d190)

Solutions

  1. If the data is ShareGPT ('from'/'value'), scan with fmt='sharegpt' instead
  2. Ensure a 'messages' column exists whose turns are dicts with 'role' and 'content' keys, then retry
  3. Pass the column explicitly when it exists under another name and has valid role/content turns: find_none_gptoss(dataset, col='...')

Example fix

# before
stats = find_none_gptoss(dataset)  # turns are {'from','value'} ShareGPT

# after
stats = find_none_sharegpt(dataset)  # correct scanner for from/value turns
# or standardize first:
# dataset = standardize_chat_format(dataset, ..., chat_column='conversations')
Defensive patterns

Strategy: validation

Validate before calling

def is_gptoss_scannable(dataset) -> bool:
    col = "messages" if "messages" in dataset.column_names else "conversations"
    if col not in dataset.column_names:
        return False
    sample = next(iter(dataset), None)
    turns = (sample or {}).get(col) or []
    return bool(turns) and isinstance(turns[0], dict) and {"role", "content"} <= turns[0].keys()

Type guard

def is_role_content_turn(turn) -> bool:
    return isinstance(turn, dict) and "role" in turn and "content" in turn

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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