unslothai/unsloth · error · HTTPException

dataset_streaming is not supported for vision or audio datas

Error message

dataset_streaming is not supported for vision or audio datasets.

What it means

HTTP 400 when dataset_streaming=true and the dataset is image (is_dataset_image) or audio (is_dataset_audio): the vision/audio loaders need random access and full materialization, so HF streaming mode is unsupported for them.

Source

Thrown at studio/backend/routes/training.py:1332

        if request.local_eval_datasets and request.eval_steps > 0:
            request.local_eval_datasets = _validate_local_dataset_paths(
                request.local_eval_datasets, "Local eval dataset"
            )

        from utils.hardware import hardware as _hw
        from utils.hardware import ensure_hardware_detected

        await asyncio.to_thread(ensure_hardware_detected)
        _validate_training_platform(request)

        if request.dataset_streaming:
            if not request.hf_dataset:
                raise HTTPException(
                    status_code = 400,
                    detail = "dataset_streaming requires hf_dataset; streaming is not supported for local datasets.",
                )
            if request.is_dataset_image or request.is_dataset_audio:
                raise HTTPException(
                    status_code = 400,
                    detail = "dataset_streaming is not supported for vision or audio datasets.",
                )
            if request.is_embedding:
                raise HTTPException(
                    status_code = 400,
                    detail = "dataset_streaming is not supported for embedding training; the embedding loader needs the full dataset.",
                )
            if _hw.DEVICE == _hw.DeviceType.MLX:
                raise HTTPException(
                    status_code = 400,
                    detail = "dataset_streaming is not yet supported on Apple Silicon (MLX); the MLX loader materializes the full dataset.",
                )
            if request.max_steps is None or request.max_steps <= 0:
                raise HTTPException(
                    status_code = 422,
                    detail = "dataset_streaming requires max_steps > 0 because streaming datasets have no known length.",
                )

View on GitHub (pinned to 203007d190)

Solutions

  1. Disable dataset_streaming for vision/audio runs - the loader will download/materialize the dataset
  2. Use a smaller or pre-subsetted HF image/audio dataset to control memory/disk
  3. Keep streaming enabled only for text-only hf_dataset runs

Example fix

// before
{"dataset_streaming": true, "is_dataset_image": true, "hf_dataset": "org/caps"}  // 400

// after
{"dataset_streaming": false, "is_dataset_image": true, "hf_dataset": "org/caps"}
Defensive patterns

Strategy: validation

Validate before calling

def streaming_config_valid(p: dict) -> bool:
    if not p.get("dataset_streaming"):
        return True
    return not (p.get("is_dataset_image") or p.get("is_dataset_audio"))

Try / catch

resp = client.post("/training/start", payload)
if resp.status_code == 400 and "vision or audio" in resp.text:
    payload["dataset_streaming"] = False
    resp = client.post("/training/start", payload)

Prevention

When it happens

Trigger: POST /training/start with dataset_streaming: true plus is_dataset_image: true or is_dataset_audio: true on an hf_dataset.

Common situations: Trying to stream a large image dataset (e.g., captioning) to avoid downloading it fully; enabling streaming globally in a config preset that also applies to multimodal runs.

Related errors


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