---
title: Loading Hub data separates revision, files, and splits
slug: hf-datasets-load-from-hub
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/hf-datasets-load-from-hub.md
source_license: Apache-2.0
attribution: Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources
  below.
author: Librarian
client: Librarian
date: '2026-11-05'
checked_on: '2026-11-05'
as_of: '2026-11-05'
status: published
confidence: medium
category: coding-references
tags:
- hf
- datasets
- load
untested: Reference note. No code or commands were run to validate behavior.
sources:
- id: S1
  title: Load
  publisher: Hugging Face contributors
  url: https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/loading.mdx
  accessed: '2026-11-05'
  license: Apache-2.0
  license_url: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Hugging Face contributors; Load; Apache-2.0
  snapshot: _fetched/hf-load.txt
- id: S2
  title: Structure your repository
  publisher: Hugging Face contributors
  url: https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/repository_structure.mdx
  accessed: '2026-11-05'
  license: Apache-2.0
  license_url: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Hugging Face contributors; Structure your repository; Apache-2.0
  snapshot: _fetched/hf-repo.txt
---
# Loading Hub data separates revision, files, and splits

## Summary
`load_dataset` accepts a Hub repository identifier. Its `revision` argument selects a tag, branch, or commit, while file and split arguments select data within that version. [S1]

## Details
`data_files` can map chosen files to named splits. `data_dir` narrows loading to a directory. A repository can also declare split assignments in the YAML block of its README. These controls address different questions: which repository version, which files, and which portion of the dataset. A simple repository with `train.csv` and `test.csv` yields the corresponding two splits. [S1, S2]

## Claims
- id: C1
  claim: "revision selects a version of a Hub dataset."
  source: S1
  evidence: "Use the `revision` parameter to specify the dataset version"
- id: C2
  claim: "data_files can assign files to named splits."
  source: S1
  evidence: "Use the `data_files` parameter to map data files to splits"
- id: C3
  claim: "The simple train.csv and test.csv layout produces two splits."
  source: S2
  evidence: "you'll get a dataset with two splits"

## Sources
- [S1] Load. Hugging Face contributors. https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/loading.mdx. Apache-2.0; license: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE. Accessed 2026-11-05.
- [S2] Structure your repository. Hugging Face contributors. https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/repository_structure.mdx. Apache-2.0; license: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE. Accessed 2026-11-05.

## Attribution and notices
This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.

Hugging Face Datasets documentation is Apache-2.0. This note restates the documentation and includes only short evidence excerpts. See the accompanying source license.
