{"record":{"id":"27e203da52ef43e1","repo":"huggingface/open-r1","slug":"no-datasets-were-loaded-from-the-mixture-configura","errorCode":null,"errorMessage":"No datasets were loaded from the mixture configuration","messagePattern":"No datasets were loaded from the mixture configuration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/open_r1/utils/data.py","lineNumber":62,"sourceCode":"            datasets_list.append(ds)\n\n        if datasets_list:\n            combined_dataset = concatenate_datasets(datasets_list)\n            combined_dataset = combined_dataset.shuffle(seed=seed)\n            logger.info(f\"Created dataset mixture with {len(combined_dataset)} examples\")\n\n            if args.dataset_mixture.test_split_size is not None:\n                combined_dataset = combined_dataset.train_test_split(\n                    test_size=args.dataset_mixture.test_split_size, seed=seed\n                )\n                logger.info(\n                    f\"Split dataset into train and test sets with test size: {args.dataset_mixture.test_split_size}\"\n                )\n                return combined_dataset\n            else:\n                return DatasetDict({\"train\": combined_dataset})\n        else:\n            raise ValueError(\"No datasets were loaded from the mixture configuration\")\n\n    else:\n        raise ValueError(\"Either `dataset_name` or `dataset_mixture` must be provided\")\n","sourceCodeStart":44,"sourceCodeEnd":66,"githubUrl":"https://github.com/huggingface/open-r1/blob/1416fa0cf21595d2083b399a2a0bbddd7f6e9563/src/open_r1/utils/data.py#L44-L66","documentation":"get_dataset raises ValueError('No datasets were loaded from the mixture configuration') when args.dataset_mixture is set but the resulting datasets_list is empty after iterating the mixture configs. In practice this fires when the mixture was configured but each load silently yielded nothing usable, or the loop never appended (datasets_list starts empty and concatenate only happens 'if datasets_list' — its else branch raises). It guards against producing an empty/malformed DatasetDict downstream.","triggerScenarios":"Calling get_dataset with args.dataset_mixture provided but datasets_list empty — e.g. dataset_mixture.datasets is an empty list, or the loading path didn't populate it (note: load_dataset failures would normally raise earlier; empty list is the direct trigger).","commonSituations":"YAML/CLI config where the `datasets:` key under dataset_mixture is empty or mis-named, so the list parses as empty; a templated config that expanded to nothing; refactor that removed entries.","solutions":["Inspect the resolved ScriptArguments and ensure dataset_mixture.datasets is a non-empty list","Check the YAML/CLI config key names (datasets, each with id/config/split)","Log each dataset_config before load_dataset to confirm iteration occurs","If a single dataset is intended, use dataset_name instead of dataset_mixture"],"exampleFix":"# before\ndataset_mixture:\n  datasets: []\n# after\ndataset_mixture:\n  datasets:\n    - id: HuggingFaceH4/ultrachat_200k\n      config: default\n      split: train_sft","handlingStrategy":"validation","validationCode":"mixture = args.dataset_mixture\nassert not (mixture and not mixture.datasets), (\n    \"dataset_mixture configured but contains no datasets\"\n) if mixture else True","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always declare at least one entry under dataset_mixture.datasets","Validate the YAML config (key names, non-empty lists) before launching jobs","Print the parsed ScriptArguments at startup in dry-run mode","Prefer dataset_name for the single-dataset case to avoid mixture plumbing entirely"],"tags":["config","datasets","validation"],"backgroundTag":"empty-dataset-mixture-config","analyzedSha":"1416fa0cf21595d2083b399a2a0bbddd7f6e9563","analyzedAt":"2026-08-30T08:56:53.400Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}