{"record":{"id":"c29cb225b60fc503","repo":"hiyouga/LlamaFactory","slug":"unknown-load-type-dataset-attr-load-from","errorCode":null,"errorMessage":"Unknown load type: {dataset_attr.load_from}.","messagePattern":"Unknown load type: (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/llamafactory/data/loader.py","lineNumber":91,"sourceCode":"    elif dataset_attr.load_from == \"file\":\n        data_files = []\n        local_path = os.path.join(data_args.dataset_dir, dataset_attr.dataset_name)\n        if os.path.isdir(local_path):  # is directory\n            for file_name in os.listdir(local_path):\n                data_files.append(os.path.join(local_path, file_name))\n        elif os.path.isfile(local_path):  # is file\n            data_files.append(local_path)\n        else:\n            raise ValueError(f\"File {local_path} not found.\")\n\n        data_path = FILEEXT2TYPE.get(os.path.splitext(data_files[0])[-1][1:], None)\n        if data_path is None:\n            raise ValueError(\"Allowed file types: {}.\".format(\",\".join(FILEEXT2TYPE.keys())))\n\n        if any(data_path != FILEEXT2TYPE.get(os.path.splitext(data_file)[-1][1:], None) for data_file in data_files):\n            raise ValueError(\"File types should be identical.\")\n    else:\n        raise NotImplementedError(f\"Unknown load type: {dataset_attr.load_from}.\")\n\n    if dataset_attr.load_from == \"ms_hub\":\n        check_version(\"modelscope>=1.14.0\", mandatory=True)\n        from modelscope import MsDataset  # type: ignore\n        from modelscope.utils.config_ds import MS_DATASETS_CACHE  # type: ignore\n\n        cache_dir = model_args.cache_dir or MS_DATASETS_CACHE\n        dataset = MsDataset.load(\n            dataset_name=data_path,\n            subset_name=data_name,\n            data_dir=data_dir,\n            data_files=data_files,\n            split=dataset_attr.split,\n            cache_dir=cache_dir,\n            token=model_args.ms_hub_token,\n            use_streaming=data_args.streaming,\n        )\n        if isinstance(dataset, MsDataset):","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/data/loader.py#L73-L109","documentation":"NotImplementedError raised in _load_single_dataset when a dataset_attr.load_from value is none of the five supported sources: hf_hub, ms_hub, script, cloud_file, file. The load_from column is derived from how the entry is keyed in dataset_info.json, so this signals an unrecognized key in your dataset definition.","triggerScenarios":"Adding an entry to dataset_info.json whose single source key is misspelled or unsupported (e.g. \"dataset_hub\", \"local_file\", \"url\"), or an entry with no recognized source key at all; also possible after manual edits or forks that introduce new loading keys.","commonSituations":"Typos when hand-editing dataset_info.json; copying an entry from an incompatible LlamaFactory version whose key names changed; assuming URL loading is supported via a key like \"url\" when it is actually \"cloud_file\".","solutions":["Open dataset_info.json and make the entry use exactly one supported key: file_name (file), hf_hub_url (hf_hub), ms_hub_url (ms_hub), script_url (script), or cloud_url (cloud_file).","For datasets hosted at an HTTP(S) URL, use the cloud_file source via the cloud_url key.","Validate your dataset_info.json against the documented schema in data/README.md after editing.","Check for duplicate/extra keys in the entry — only one source key should be present."],"exampleFix":"# before (dataset_info.json)\n\"mydata\": {\"url\": \"https://example.com/data.jsonl\"}\n\n# after\n\"mydata\": {\"cloud_url\": \"https://example.com/data.jsonl\"}","handlingStrategy":"validation","validationCode":"import json\n\nALLOWED = {\"file_name\", \"hf_hub_url\", \"ms_hub_url\", \"script_url\", \"cloud_url\"}\n\ndef entries_ok(info_path: str) -> list[str]:\n    bad = []\n    for name, cfg in json.load(open(info_path)).items():\n        if not (set(cfg) & ALLOWED):\n            bad.append(name)\n    return bad","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy dataset_info.json entries from data/README.md examples rather than typing keys.","Re-validate dataset_info.json after upgrades (key names occasionally change).","Use exactly one source key per entry."],"tags":["dataset","dataset-info","config"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}