{"record":{"id":"e2375e2963bcbbbf","repo":"unslothai/unsloth","slug":"dataset-streaming-is-not-supported-for-vision-or-a","errorCode":null,"errorMessage":"dataset_streaming is not supported for vision or audio datasets.","messagePattern":"dataset_streaming is not supported for vision or audio datasets\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":1332,"sourceCode":"        if request.local_eval_datasets and request.eval_steps > 0:\n            request.local_eval_datasets = _validate_local_dataset_paths(\n                request.local_eval_datasets, \"Local eval dataset\"\n            )\n\n        from utils.hardware import hardware as _hw\n        from utils.hardware import ensure_hardware_detected\n\n        await asyncio.to_thread(ensure_hardware_detected)\n        _validate_training_platform(request)\n\n        if request.dataset_streaming:\n            if not request.hf_dataset:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = \"dataset_streaming requires hf_dataset; streaming is not supported for local datasets.\",\n                )\n            if request.is_dataset_image or request.is_dataset_audio:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = \"dataset_streaming is not supported for vision or audio datasets.\",\n                )\n            if request.is_embedding:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = \"dataset_streaming is not supported for embedding training; the embedding loader needs the full dataset.\",\n                )\n            if _hw.DEVICE == _hw.DeviceType.MLX:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = \"dataset_streaming is not yet supported on Apple Silicon (MLX); the MLX loader materializes the full dataset.\",\n                )\n            if request.max_steps is None or request.max_steps <= 0:\n                raise HTTPException(\n                    status_code = 422,\n                    detail = \"dataset_streaming requires max_steps > 0 because streaming datasets have no known length.\",\n                )","sourceCodeStart":1314,"sourceCodeEnd":1350,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L1314-L1350","documentation":"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.","triggerScenarios":"POST /training/start with dataset_streaming: true plus is_dataset_image: true or is_dataset_audio: true on an hf_dataset.","commonSituations":"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.","solutions":["Disable dataset_streaming for vision/audio runs - the loader will download/materialize the dataset","Use a smaller or pre-subsetted HF image/audio dataset to control memory/disk","Keep streaming enabled only for text-only hf_dataset runs"],"exampleFix":"// before\n{\"dataset_streaming\": true, \"is_dataset_image\": true, \"hf_dataset\": \"org/caps\"}  // 400\n\n// after\n{\"dataset_streaming\": false, \"is_dataset_image\": true, \"hf_dataset\": \"org/caps\"}","handlingStrategy":"validation","validationCode":"def streaming_config_valid(p: dict) -> bool:\n    if not p.get(\"dataset_streaming\"):\n        return True\n    return not (p.get(\"is_dataset_image\") or p.get(\"is_dataset_audio\"))","typeGuard":null,"tryCatchPattern":"resp = client.post(\"/training/start\", payload)\nif resp.status_code == 400 and \"vision or audio\" in resp.text:\n    payload[\"dataset_streaming\"] = False\n    resp = client.post(\"/training/start\", payload)","preventionTips":["Disable streaming automatically for multimodal (image/audio) runs","Plan disk space for full materialization of vision/audio datasets","Centralize the streaming eligibility check in your config builder"],"tags":["training","dataset-streaming","vision","audio","http-400"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}