{"record":{"id":"18a1b7571de57d6c","repo":"unslothai/unsloth","slug":"dataset-streaming-is-not-supported-with-train-on-c","errorCode":null,"errorMessage":"dataset_streaming is not supported with train_on_completions yet.","messagePattern":"dataset_streaming is not supported with train_on_completions yet\\.","errorType":"http","errorClass":"HTTPException","httpStatus":422,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":1352,"sourceCode":"                    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                )\n            if request.train_on_completions:\n                raise HTTPException(\n                    status_code = 422,\n                    detail = \"dataset_streaming is not supported with train_on_completions yet.\",\n                )\n            if request.eval_steps > 0:\n                train_split = request.train_split or \"train\"\n                if not request.eval_split or request.eval_split == train_split:\n                    raise HTTPException(\n                        status_code = 422,\n                        detail = \"dataset_streaming with evaluation requires a separate eval_split.\",\n                    )\n            # Streaming is HF-only: reject when the request also carries a local dataset path or an\n            # S3 config, since those sources cannot be streamed via HF's loader.\n            if request.local_datasets:\n                raise HTTPException(\n                    status_code = 400,\n                    detail = (\n                        \"dataset_streaming is HF-only; remove local_datasets / S3 source. \"\n                        \"Streaming is not supported with local file paths.\"","sourceCodeStart":1334,"sourceCodeEnd":1370,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L1334-L1370","documentation":"HTTP 422 when dataset_streaming=true and train_on_completions is set: completion-only masking over streamed batches is not implemented yet, so the combination is explicitly rejected (a 'yet' limitation, not a permanent design rule).","triggerScenarios":"POST /training/start with dataset_streaming: true and train_on_completions: true.","commonSituations":"Trying to stream a large instruction dataset while training on completions only (common for chat fine-tuning); combining two memory-saving options that are not yet compatible.","solutions":["Disable dataset_streaming and keep train_on_completions (dataset is materialized)","Or keep streaming and drop train_on_completions for this run","Track backend releases - the 'yet' indicates planned support"],"exampleFix":"// before\n{\"dataset_streaming\": true, \"train_on_completions\": true}  // 422\n\n// after\n{\"dataset_streaming\": false, \"train_on_completions\": true}","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(\"train_on_completions\")","typeGuard":null,"tryCatchPattern":"resp = client.post(\"/training/start\", payload)\nif resp.status_code == 422 and \"train_on_completions\" in resp.text:\n    # pick one: materialize dataset OR train on full sequences\n    payload[\"dataset_streaming\"] = False\n    resp = client.post(\"/training/start\", payload)","preventionTips":["Treat streaming + train_on_completions as mutually exclusive for now","Decide which of the two matters more for the run before configuring","Watch release notes: the backend marks this limitation as temporary"],"tags":["training","dataset-streaming","train-on-completions","http-422","not-implemented"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}