datasets 4.8.4__tar.gz → 5.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datasets-4.8.4/src/datasets.egg-info → datasets-5.0.0}/PKG-INFO +166 -44
- {datasets-4.8.4 → datasets-5.0.0}/README.md +151 -42
- {datasets-4.8.4 → datasets-5.0.0}/setup.py +13 -2
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/__init__.py +1 -1
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/arrow_dataset.py +64 -18
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/arrow_writer.py +16 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/builder.py +53 -105
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/test.py +1 -1
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/config.py +6 -1
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/dataset_dict.py +5 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/download_manager.py +2 -2
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/__init__.py +2 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/audio.py +34 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/features.py +14 -4
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/image.py +34 -5
- datasets-5.0.0/src/datasets/features/mesh.py +295 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/nifti.py +34 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/pdf.py +34 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/video.py +34 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/hub.py +13 -2
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/info.py +13 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/csv.py +1 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/generator.py +1 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/json.py +8 -4
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/parquet.py +1 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/sql.py +1 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/text.py +1 -3
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/iterable_dataset.py +352 -127
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/load.py +20 -10
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/__init__.py +18 -0
- datasets-5.0.0/src/datasets/packaged_modules/conll/conll.py +155 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py +3 -2
- datasets-5.0.0/src/datasets/packaged_modules/iceberg/iceberg.py +173 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/json/json.py +227 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/lance/lance.py +2 -1
- datasets-5.0.0/src/datasets/packaged_modules/meshfolder/meshfolder.py +31 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/parquet/parquet.py +41 -24
- datasets-5.0.0/src/datasets/packaged_modules/tsfile/tsfile.py +773 -0
- datasets-5.0.0/src/datasets/packaged_modules/videofolder/__init__.py +0 -0
- datasets-5.0.0/src/datasets/packaged_modules/webdataset/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/webdataset/webdataset.py +19 -1
- datasets-5.0.0/src/datasets/packaged_modules/xml/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/splits.py +10 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/table.py +102 -5
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/file_utils.py +8 -1
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/info_utils.py +1 -1
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/json.py +28 -8
- datasets-5.0.0/src/datasets/utils/resources/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0/src/datasets.egg-info}/PKG-INFO +166 -44
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/SOURCES.txt +9 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/requires.txt +16 -1
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_arrow_dataset.py +239 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_builder.py +47 -314
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_inspect.py +9 -5
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_iterable_dataset.py +235 -18
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_load.py +6 -6
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_offline_util.py +4 -4
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_tqdm.py +2 -2
- {datasets-4.8.4 → datasets-5.0.0}/AUTHORS +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/LICENSE +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/pyproject.toml +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/setup.cfg +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/arrow_reader.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/combine.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/datasets_cli.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/delete_from_hub.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/env.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/data_files.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/distributed.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/download_config.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/streaming_download_manager.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/exceptions.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/_torchcodec.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/translation.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/filesystems/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/filesystems/compression.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/fingerprint.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/formatting.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/jax_formatter.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/np_formatter.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/polars_formatter.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/tf_formatter.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/torch_formatter.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/inspect.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/abc.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/spark.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/naming.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/arrow/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/arrow/arrow.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/audiofolder/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/audiofolder/audiofolder.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/cache/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/cache/cache.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/csv → datasets-5.0.0/src/datasets/packaged_modules/conll}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/eval → datasets-5.0.0/src/datasets/packaged_modules/csv}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/csv/csv.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/folder_based_builder → datasets-5.0.0/src/datasets/packaged_modules/eval}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/eval/eval.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/generator → datasets-5.0.0/src/datasets/packaged_modules/folder_based_builder}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/hdf5 → datasets-5.0.0/src/datasets/packaged_modules/generator}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/generator/generator.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/imagefolder → datasets-5.0.0/src/datasets/packaged_modules/hdf5}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/hdf5/hdf5.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/json → datasets-5.0.0/src/datasets/packaged_modules/iceberg}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/lance → datasets-5.0.0/src/datasets/packaged_modules/imagefolder}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/imagefolder/imagefolder.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/niftifolder → datasets-5.0.0/src/datasets/packaged_modules/json}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/pandas → datasets-5.0.0/src/datasets/packaged_modules/lance}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/parquet → datasets-5.0.0/src/datasets/packaged_modules/meshfolder}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/pdffolder → datasets-5.0.0/src/datasets/packaged_modules/niftifolder}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/niftifolder/niftifolder.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/spark → datasets-5.0.0/src/datasets/packaged_modules/pandas}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/pandas/pandas.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/sql → datasets-5.0.0/src/datasets/packaged_modules/parquet}/__init__.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/text → datasets-5.0.0/src/datasets/packaged_modules/pdffolder}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/pdffolder/pdffolder.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/videofolder → datasets-5.0.0/src/datasets/packaged_modules/spark}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/spark/spark.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/webdataset → datasets-5.0.0/src/datasets/packaged_modules/sql}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/sql/sql.py +0 -0
- {datasets-4.8.4/src/datasets/packaged_modules/xml → datasets-5.0.0/src/datasets/packaged_modules/text}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/text/text.py +0 -0
- {datasets-4.8.4/src/datasets/utils/resources → datasets-5.0.0/src/datasets/packaged_modules/tsfile}/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/videofolder/videofolder.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/webdataset/_tenbin.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/xml/xml.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/parallel/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/parallel/parallel.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/search.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/streaming.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/__init__.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/_dataset_viewer.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/_dill.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/_filelock.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/deprecation_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/doc_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/experimental.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/extract.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/filelock.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/hub.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/logging.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/metadata.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/patching.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/py_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/creators.json +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/languages.json +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/multilingualities.json +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/readme_structure.yaml +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/size_categories.json +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/sharding.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/stratify.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/tf_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/tqdm.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/track.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/typing.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/version.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/dependency_links.txt +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/entry_points.txt +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/not-zip-safe +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/top_level.txt +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_arrow_reader.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_arrow_writer.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_data_files.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_dataset_dict.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_dataset_list.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_distributed.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_download_manager.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_exceptions.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_experimental.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_extract.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_file_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_filelock.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_filesystem.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_fingerprint.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_fingerprint_tokenizer_stability.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_formatting.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_hub.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_info.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_info_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_metadata_util.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_parallel.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_patching.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_py_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_search.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_sharding_utils.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_splits.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_streaming_download_manager.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_table.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_upstream_hub.py +0 -0
- {datasets-4.8.4 → datasets-5.0.0}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: datasets
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.0
|
|
4
4
|
Summary: HuggingFace community-driven open-source library of datasets
|
|
5
5
|
Home-page: https://github.com/huggingface/datasets
|
|
6
6
|
Download-URL: https://github.com/huggingface/datasets/tags
|
|
@@ -35,7 +35,7 @@ Requires-Dist: httpx<1.0.0
|
|
|
35
35
|
Requires-Dist: tqdm>=4.66.3
|
|
36
36
|
Requires-Dist: xxhash
|
|
37
37
|
Requires-Dist: multiprocess<0.70.20
|
|
38
|
-
Requires-Dist: fsspec[http]<=2026.
|
|
38
|
+
Requires-Dist: fsspec[http]<=2026.4.0,>=2023.1.0
|
|
39
39
|
Requires-Dist: huggingface-hub<2.0,>=0.25.0
|
|
40
40
|
Requires-Dist: packaging
|
|
41
41
|
Requires-Dist: pyyaml>=5.1
|
|
@@ -44,6 +44,8 @@ Requires-Dist: torchcodec>=0.6.0; extra == "audio"
|
|
|
44
44
|
Requires-Dist: torch>=2.8.0; extra == "audio"
|
|
45
45
|
Provides-Extra: vision
|
|
46
46
|
Requires-Dist: Pillow>=9.4.0; extra == "vision"
|
|
47
|
+
Provides-Extra: mesh
|
|
48
|
+
Requires-Dist: trimesh>=4.10.0; extra == "mesh"
|
|
47
49
|
Provides-Extra: tensorflow
|
|
48
50
|
Requires-Dist: tensorflow>=2.6.0; extra == "tensorflow"
|
|
49
51
|
Provides-Extra: tensorflow-gpu
|
|
@@ -68,6 +70,7 @@ Requires-Dist: elasticsearch<8.0.0,>=7.17.12; extra == "dev"
|
|
|
68
70
|
Requires-Dist: faiss-cpu>=1.8.0.post1; extra == "dev"
|
|
69
71
|
Requires-Dist: h5py; extra == "dev"
|
|
70
72
|
Requires-Dist: pylance; extra == "dev"
|
|
73
|
+
Requires-Dist: pyiceberg[pyarrow,sql-sqlite]; extra == "dev"
|
|
71
74
|
Requires-Dist: jax>=0.3.14; sys_platform != "win32" and extra == "dev"
|
|
72
75
|
Requires-Dist: jaxlib>=0.3.14; sys_platform != "win32" and extra == "dev"
|
|
73
76
|
Requires-Dist: lz4; python_version < "3.14" and extra == "dev"
|
|
@@ -88,6 +91,8 @@ Requires-Dist: polars[timezone]>=0.20.0; extra == "dev"
|
|
|
88
91
|
Requires-Dist: Pillow>=9.4.0; extra == "dev"
|
|
89
92
|
Requires-Dist: torchcodec>=0.7.0; python_version < "3.14" and extra == "dev"
|
|
90
93
|
Requires-Dist: nibabel>=5.3.1; extra == "dev"
|
|
94
|
+
Requires-Dist: trimesh>=4.10.0; extra == "dev"
|
|
95
|
+
Requires-Dist: teich==0.1.1a76; extra == "dev"
|
|
91
96
|
Requires-Dist: ruff>=0.3.0; extra == "dev"
|
|
92
97
|
Requires-Dist: transformers; extra == "dev"
|
|
93
98
|
Requires-Dist: torch; extra == "dev"
|
|
@@ -106,6 +111,7 @@ Requires-Dist: elasticsearch<8.0.0,>=7.17.12; extra == "tests"
|
|
|
106
111
|
Requires-Dist: faiss-cpu>=1.8.0.post1; extra == "tests"
|
|
107
112
|
Requires-Dist: h5py; extra == "tests"
|
|
108
113
|
Requires-Dist: pylance; extra == "tests"
|
|
114
|
+
Requires-Dist: pyiceberg[pyarrow,sql-sqlite]; extra == "tests"
|
|
109
115
|
Requires-Dist: jax>=0.3.14; sys_platform != "win32" and extra == "tests"
|
|
110
116
|
Requires-Dist: jaxlib>=0.3.14; sys_platform != "win32" and extra == "tests"
|
|
111
117
|
Requires-Dist: lz4; python_version < "3.14" and extra == "tests"
|
|
@@ -126,6 +132,8 @@ Requires-Dist: polars[timezone]>=0.20.0; extra == "tests"
|
|
|
126
132
|
Requires-Dist: Pillow>=9.4.0; extra == "tests"
|
|
127
133
|
Requires-Dist: torchcodec>=0.7.0; python_version < "3.14" and extra == "tests"
|
|
128
134
|
Requires-Dist: nibabel>=5.3.1; extra == "tests"
|
|
135
|
+
Requires-Dist: trimesh>=4.10.0; extra == "tests"
|
|
136
|
+
Requires-Dist: teich==0.1.1a76; extra == "tests"
|
|
129
137
|
Provides-Extra: tests-numpy2
|
|
130
138
|
Requires-Dist: numba>=0.56.4; python_version < "3.14" and extra == "tests-numpy2"
|
|
131
139
|
Requires-Dist: absl-py; extra == "tests-numpy2"
|
|
@@ -139,6 +147,7 @@ Requires-Dist: aiohttp; extra == "tests-numpy2"
|
|
|
139
147
|
Requires-Dist: elasticsearch<8.0.0,>=7.17.12; extra == "tests-numpy2"
|
|
140
148
|
Requires-Dist: h5py; extra == "tests-numpy2"
|
|
141
149
|
Requires-Dist: pylance; extra == "tests-numpy2"
|
|
150
|
+
Requires-Dist: pyiceberg[pyarrow,sql-sqlite]; extra == "tests-numpy2"
|
|
142
151
|
Requires-Dist: jax>=0.3.14; sys_platform != "win32" and extra == "tests-numpy2"
|
|
143
152
|
Requires-Dist: jaxlib>=0.3.14; sys_platform != "win32" and extra == "tests-numpy2"
|
|
144
153
|
Requires-Dist: lz4; python_version < "3.14" and extra == "tests-numpy2"
|
|
@@ -157,6 +166,8 @@ Requires-Dist: polars[timezone]>=0.20.0; extra == "tests-numpy2"
|
|
|
157
166
|
Requires-Dist: Pillow>=9.4.0; extra == "tests-numpy2"
|
|
158
167
|
Requires-Dist: torchcodec>=0.7.0; python_version < "3.14" and extra == "tests-numpy2"
|
|
159
168
|
Requires-Dist: nibabel>=5.3.1; extra == "tests-numpy2"
|
|
169
|
+
Requires-Dist: trimesh>=4.10.0; extra == "tests-numpy2"
|
|
170
|
+
Requires-Dist: teich==0.1.1a76; extra == "tests-numpy2"
|
|
160
171
|
Provides-Extra: quality
|
|
161
172
|
Requires-Dist: ruff>=0.3.0; extra == "quality"
|
|
162
173
|
Provides-Extra: benchmarks
|
|
@@ -172,6 +183,8 @@ Requires-Dist: pdfplumber>=0.11.4; extra == "pdfs"
|
|
|
172
183
|
Provides-Extra: nibabel
|
|
173
184
|
Requires-Dist: nibabel>=5.3.2; extra == "nibabel"
|
|
174
185
|
Requires-Dist: ipyniivue==2.4.2; extra == "nibabel"
|
|
186
|
+
Provides-Extra: iceberg
|
|
187
|
+
Requires-Dist: pyiceberg>=0.7.0; extra == "iceberg"
|
|
175
188
|
Dynamic: author
|
|
176
189
|
Dynamic: author-email
|
|
177
190
|
Dynamic: classifier
|
|
@@ -208,8 +221,8 @@ Dynamic: summary
|
|
|
208
221
|
|
|
209
222
|
🤗 Datasets is a lightweight library providing **two** main features:
|
|
210
223
|
|
|
211
|
-
- **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the  major public datasets (image datasets, audio datasets, text datasets in 467 languages and dialects, etc.) provided on the [HuggingFace Datasets Hub](https://huggingface.co/datasets). With a simple command like `squad_dataset = load_dataset("rajpurkar/squad")`, get any of these datasets ready to use in a dataloader for training/evaluating a ML model (Numpy/Pandas/PyTorch/TensorFlow/JAX),
|
|
212
|
-
- **efficient data pre-processing**: simple, fast and reproducible data pre-processing for the public datasets as well as your own local datasets in CSV, JSON, text, PNG, JPEG, WAV, MP3,
|
|
224
|
+
- **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the  major public datasets (image datasets, audio datasets, text datasets in 467 languages and dialects, 3D medical images, video datasets, agent traces, etc.) provided on the [HuggingFace Datasets Hub](https://huggingface.co/datasets). With a simple command like `squad_dataset = load_dataset("rajpurkar/squad")`, get any of these datasets ready to use in a dataloader for training/evaluating a ML model (Numpy/Pandas/PyTorch/TensorFlow/JAX/Polars),
|
|
225
|
+
- **efficient data pre-processing**: simple, fast and reproducible data pre-processing for the public datasets as well as your own local datasets in CSV, JSON, JSONL, Parquet, HDF5, XML, text, PNG, JPEG, WAV, MP3, PDF, NIfTI, and more. With simple commands like `processed_dataset = dataset.map(process_example)`, efficiently prepare the dataset for inspection and ML model evaluation and training.
|
|
213
226
|
|
|
214
227
|
[🎓 **Documentation**](https://huggingface.co/docs/datasets/) [🔎 **Find a dataset in the Hub**](https://huggingface.co/datasets) [🌟 **Share a dataset on the Hub**](https://huggingface.co/docs/datasets/share)
|
|
215
228
|
|
|
@@ -217,63 +230,77 @@ Dynamic: summary
|
|
|
217
230
|
<a href="https://hf.co/course"><img src="https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/imgs/course_banner.png"></a>
|
|
218
231
|
</h3>
|
|
219
232
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
🤗 Datasets
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
# 🚀 Key Features
|
|
234
|
+
|
|
235
|
+
🤗 Datasets is designed to let the community easily add and share new datasets, and provides powerful capabilities for data manipulation:
|
|
236
|
+
|
|
237
|
+
| Feature | Description |
|
|
238
|
+
|---------|-------------|
|
|
239
|
+
| 📦 **One-line dataset loading** | Load AI-ready datasets from the [Hugging Face Hub](https://huggingface.co/datasets) or local files with `load_dataset()` |
|
|
240
|
+
| 🔍 **Multiple formats** | Native support for CSV, JSON, JSONL, Parquet, Arrow, XML, Text, Webdataset, and more |
|
|
241
|
+
| 🖼️ **Multi-modal data** | Built-in support for text, audio, image, video, PDF, and NIfTI (3D medical) data |
|
|
242
|
+
| 🚀 **Streaming mode** | Stream datasets without downloading — iterate over data on-the-fly with `streaming=True` (now up to **100x faster** with Xet backend) |
|
|
243
|
+
| 💾 **HF Storage Buckets** | Read and write directly from/to [Hugging Face Storage Buckets](https://huggingface.co/docs/hub/storage-buckets) for mutable, large-scale raw data |
|
|
244
|
+
| 🧠 **AI Agent Traces** | Load and process AI agent traces (prompts, tool calls, responses) from the Hub |
|
|
245
|
+
| ⚡ **Apache Arrow backend** | Zero-copy memory-mapped storage — datasets naturally free you from RAM limitations |
|
|
246
|
+
| 🔄 **Smart caching** | Never wait for your data to process twice — cached results are automatically reused |
|
|
247
|
+
| 📊 **Multi-framework interoperability** | Native conversion to/from NumPy, Pandas, Polars, Arrow, PyTorch, TensorFlow, JAX, and Spark |
|
|
248
|
+
| 🏎️ **Multi-processing** | Fast parallel data processing with `map(num_proc=N)` |
|
|
249
|
+
| 🔎 **Search & index** | Built-in FAISS and Elasticsearch index support for similarity search |
|
|
250
|
+
| 📦 **JSON type** | Flexible JSON/structured data support with `Json()` feature type |
|
|
232
251
|
|
|
233
252
|
# Installation
|
|
234
253
|
|
|
235
254
|
## With pip
|
|
236
255
|
|
|
237
|
-
🤗 Datasets can be installed from PyPi and
|
|
256
|
+
🤗 Datasets can be installed from PyPi and should be installed in a virtual environment (venv or conda for instance):
|
|
238
257
|
|
|
239
258
|
```bash
|
|
240
259
|
pip install datasets
|
|
241
260
|
```
|
|
242
261
|
|
|
243
|
-
|
|
262
|
+
For the latest development version:
|
|
244
263
|
|
|
245
|
-
|
|
264
|
+
```bash
|
|
265
|
+
pip install "datasets @ git+https://github.com/huggingface/datasets.git"
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## With conda
|
|
246
269
|
|
|
247
270
|
```bash
|
|
248
271
|
conda install -c huggingface -c conda-forge datasets
|
|
249
272
|
```
|
|
250
273
|
|
|
251
|
-
|
|
274
|
+
## Optional dependencies
|
|
275
|
+
|
|
276
|
+
🤗 Datasets supports various optional features via extras:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# For audio (torchcodec)
|
|
280
|
+
pip install datasets[audio]
|
|
252
281
|
|
|
253
|
-
For
|
|
282
|
+
# For image/video (Pillow, torchcodec)
|
|
283
|
+
pip install datasets[vision]
|
|
254
284
|
|
|
255
|
-
|
|
285
|
+
# For PDFs/NIfTI (pdfplumber, nibabel)
|
|
286
|
+
pip install datasets[pdfs,nibabel]
|
|
256
287
|
|
|
257
|
-
|
|
258
|
-
|
|
288
|
+
# For PyTorch/TensorFlow/JAX integration
|
|
289
|
+
pip install datasets[torch,tensorflow,jax]
|
|
259
290
|
|
|
260
|
-
|
|
291
|
+
```
|
|
261
292
|
|
|
262
|
-
|
|
293
|
+
For more details on installation, check the [installation page](https://huggingface.co/docs/datasets/installation).
|
|
263
294
|
|
|
264
|
-
|
|
295
|
+
# Quick Start
|
|
265
296
|
|
|
266
|
-
|
|
297
|
+
🤗 Datasets is made to be very simple to use — the API is centered around a single function, `datasets.load_dataset(dataset_name, **kwargs)`, that instantiates a dataset.
|
|
267
298
|
|
|
268
299
|
Here is a quick example:
|
|
269
300
|
|
|
270
301
|
```python
|
|
271
302
|
from datasets import load_dataset
|
|
272
303
|
|
|
273
|
-
# Print all the available datasets
|
|
274
|
-
from huggingface_hub import list_datasets
|
|
275
|
-
print([dataset.id for dataset in list_datasets(limit=20)])
|
|
276
|
-
|
|
277
304
|
# Load a dataset and print the first example in the training set
|
|
278
305
|
squad_dataset = load_dataset('rajpurkar/squad')
|
|
279
306
|
print(squad_dataset['train'][0])
|
|
@@ -281,32 +308,118 @@ print(squad_dataset['train'][0])
|
|
|
281
308
|
# Process the dataset - add a column with the length of the context texts
|
|
282
309
|
dataset_with_length = squad_dataset.map(lambda x: {"length": len(x["context"])})
|
|
283
310
|
|
|
284
|
-
#
|
|
311
|
+
# Tokenize the context texts (using a tokenizer from the 🤗 Transformers library)
|
|
285
312
|
from transformers import AutoTokenizer
|
|
286
313
|
tokenizer = AutoTokenizer.from_pretrained('bert-base-cased')
|
|
287
314
|
|
|
288
315
|
tokenized_dataset = squad_dataset.map(lambda x: tokenizer(x['context']), batched=True)
|
|
316
|
+
|
|
317
|
+
# Tokenize chat conversations with a chat template (using a model that supports chat templates)
|
|
318
|
+
# This is useful for fine-tuning instruction/chat models
|
|
319
|
+
|
|
320
|
+
# Load a popular chat dataset (ultrachat_200k contains ~200k AI assistant conversations)
|
|
321
|
+
chat_dataset = load_dataset('HuggingFaceH4/ultrachat_200k', split='train_sft')
|
|
322
|
+
|
|
323
|
+
chat_tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen2.5-7B-Instruct')
|
|
324
|
+
|
|
325
|
+
def tokenize_chat(examples):
|
|
326
|
+
# Apply the chat template and tokenize in one step
|
|
327
|
+
return chat_tokenizer.apply_chat_template(examples["messages"])
|
|
328
|
+
|
|
329
|
+
tokenized_chat_dataset = chat_dataset.map(tokenize_chat, batched=True)
|
|
289
330
|
```
|
|
290
331
|
|
|
332
|
+
## Streaming mode
|
|
333
|
+
|
|
291
334
|
If your dataset is bigger than your disk or if you don't want to wait to download the data, you can use streaming:
|
|
292
335
|
|
|
293
336
|
```python
|
|
294
|
-
#
|
|
337
|
+
# Stream the dataset without downloading anything
|
|
295
338
|
image_dataset = load_dataset('timm/imagenet-1k-wds', streaming=True)
|
|
296
339
|
for example in image_dataset["train"]:
|
|
340
|
+
print(example["image"])
|
|
297
341
|
break
|
|
298
342
|
```
|
|
299
343
|
|
|
300
|
-
|
|
344
|
+
## Multi-modal data
|
|
301
345
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
-
|
|
346
|
+
🤗 Datasets supports a wide variety of data types out of the box:
|
|
347
|
+
|
|
348
|
+
```python
|
|
349
|
+
# Audio dataset
|
|
350
|
+
dataset = load_dataset("openslr/librispeech_asr", "clean")
|
|
351
|
+
|
|
352
|
+
# Image dataset
|
|
353
|
+
dataset = load_dataset("ILSVRC/imagenet-1k")
|
|
354
|
+
|
|
355
|
+
# Video dataset
|
|
356
|
+
dataset = load_dataset("Shofo/shofo-tiktok-general-small")
|
|
357
|
+
|
|
358
|
+
# PDF documents
|
|
359
|
+
dataset = load_dataset("pixparse/pdfa-eng-wds")
|
|
360
|
+
|
|
361
|
+
# NIfTI (3D medical imaging)
|
|
362
|
+
dataset = load_dataset("dartbrains/localizer", "betas")
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## From local files
|
|
366
|
+
|
|
367
|
+
```python
|
|
368
|
+
# Load from local CSV
|
|
369
|
+
dataset = load_dataset('csv', data_files='my_data.csv')
|
|
370
|
+
|
|
371
|
+
# Load from local Parquet
|
|
372
|
+
dataset = load_dataset('parquet', data_files='data/*.parquet')
|
|
373
|
+
|
|
374
|
+
# Load from a local directory (auto-detect format)
|
|
375
|
+
dataset = load_dataset('./path/to/data')
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## From Python objects
|
|
379
|
+
|
|
380
|
+
```python
|
|
381
|
+
from datasets import Dataset
|
|
382
|
+
|
|
383
|
+
# From a dictionary
|
|
384
|
+
dataset = Dataset.from_dict({"text": ["Hello world", "How are you?"]})
|
|
385
|
+
|
|
386
|
+
# From a list
|
|
387
|
+
dataset = Dataset.from_list([{"text": "Hello world"}, {"text": "How are you?"}])
|
|
388
|
+
|
|
389
|
+
# From Pandas
|
|
390
|
+
import pandas as pd
|
|
391
|
+
df = pd.DataFrame({"col1": [1, 2, 3], "col2": ["a", "b", "c"]})
|
|
392
|
+
dataset = Dataset.from_pandas(df)
|
|
393
|
+
|
|
394
|
+
# From a generator
|
|
395
|
+
def gen():
|
|
396
|
+
for i in range(10):
|
|
397
|
+
yield {"value": i}
|
|
398
|
+
dataset = Dataset.from_generator(gen)
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
For more details on using the library, check the [quick start guide](https://huggingface.co/docs/datasets/quickstart) and the specific pages on:
|
|
402
|
+
|
|
403
|
+
- [Loading a dataset](https://huggingface.co/docs/datasets/loading)
|
|
404
|
+
- [What's in a Dataset](https://huggingface.co/docs/datasets/access)
|
|
405
|
+
- [Processing data with 🤗 Datasets](https://huggingface.co/docs/datasets/process)
|
|
406
|
+
- [Processing audio data](https://huggingface.co/docs/datasets/audio_process)
|
|
407
|
+
- [Processing image data](https://huggingface.co/docs/datasets/image_process)
|
|
408
|
+
- [Processing text data](https://huggingface.co/docs/datasets/nlp_process)
|
|
409
|
+
- [Processing PDF data](https://huggingface.co/docs/datasets/pdf_process)
|
|
410
|
+
- [Processing video data](https://huggingface.co/docs/datasets/video_process)
|
|
411
|
+
- [Streaming a dataset](https://huggingface.co/docs/datasets/stream)
|
|
412
|
+
|
|
413
|
+
# Core Classes
|
|
414
|
+
|
|
415
|
+
The library provides two main dataset classes:
|
|
416
|
+
|
|
417
|
+
| Class | Description |
|
|
418
|
+
|-------|-------------|
|
|
419
|
+
| `Dataset` | In-memory / memory-mapped dataset backed by Apache Arrow. Supports indexing, slicing, random access and caching. |
|
|
420
|
+
| `IterableDataset` | Lazy, streamable dataset for large-scale / out-of-core processing. Supports streaming and infinite iteration. |
|
|
421
|
+
|
|
422
|
+
Both are wrapped in `DatasetDict` / `IterableDatasetDict` for multi-split datasets (e.g., train/test/val).
|
|
310
423
|
|
|
311
424
|
# Add a new dataset to the Hub
|
|
312
425
|
|
|
@@ -322,7 +435,16 @@ You can use 🤗 Datasets to load datasets based on versioned git repositories m
|
|
|
322
435
|
|
|
323
436
|
If you're a dataset owner and wish to update any part of it (description, citation, license, etc.), or do not want your dataset to be included in the Hugging Face Hub, please get in touch by opening a discussion or a pull request in the Community tab of the dataset page. Thanks for your contribution to the ML community!
|
|
324
437
|
|
|
325
|
-
|
|
438
|
+
# Contributing
|
|
439
|
+
|
|
440
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on:
|
|
441
|
+
|
|
442
|
+
- How to submit issues and pull requests
|
|
443
|
+
- Code style guidelines (we use [Ruff](https://docs.astral.sh/ruff/))
|
|
444
|
+
- Testing requirements
|
|
445
|
+
- Documentation standards
|
|
446
|
+
|
|
447
|
+
# BibTeX
|
|
326
448
|
|
|
327
449
|
If you want to cite our 🤗 Datasets library, you can use our [paper](https://huggingface.co/papers/2109.02846):
|
|
328
450
|
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
🤗 Datasets is a lightweight library providing **two** main features:
|
|
22
22
|
|
|
23
|
-
- **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the  major public datasets (image datasets, audio datasets, text datasets in 467 languages and dialects, etc.) provided on the [HuggingFace Datasets Hub](https://huggingface.co/datasets). With a simple command like `squad_dataset = load_dataset("rajpurkar/squad")`, get any of these datasets ready to use in a dataloader for training/evaluating a ML model (Numpy/Pandas/PyTorch/TensorFlow/JAX),
|
|
24
|
-
- **efficient data pre-processing**: simple, fast and reproducible data pre-processing for the public datasets as well as your own local datasets in CSV, JSON, text, PNG, JPEG, WAV, MP3,
|
|
23
|
+
- **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the  major public datasets (image datasets, audio datasets, text datasets in 467 languages and dialects, 3D medical images, video datasets, agent traces, etc.) provided on the [HuggingFace Datasets Hub](https://huggingface.co/datasets). With a simple command like `squad_dataset = load_dataset("rajpurkar/squad")`, get any of these datasets ready to use in a dataloader for training/evaluating a ML model (Numpy/Pandas/PyTorch/TensorFlow/JAX/Polars),
|
|
24
|
+
- **efficient data pre-processing**: simple, fast and reproducible data pre-processing for the public datasets as well as your own local datasets in CSV, JSON, JSONL, Parquet, HDF5, XML, text, PNG, JPEG, WAV, MP3, PDF, NIfTI, and more. With simple commands like `processed_dataset = dataset.map(process_example)`, efficiently prepare the dataset for inspection and ML model evaluation and training.
|
|
25
25
|
|
|
26
26
|
[🎓 **Documentation**](https://huggingface.co/docs/datasets/) [🔎 **Find a dataset in the Hub**](https://huggingface.co/datasets) [🌟 **Share a dataset on the Hub**](https://huggingface.co/docs/datasets/share)
|
|
27
27
|
|
|
@@ -29,63 +29,77 @@
|
|
|
29
29
|
<a href="https://hf.co/course"><img src="https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/imgs/course_banner.png"></a>
|
|
30
30
|
</h3>
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
🤗 Datasets
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
# 🚀 Key Features
|
|
33
|
+
|
|
34
|
+
🤗 Datasets is designed to let the community easily add and share new datasets, and provides powerful capabilities for data manipulation:
|
|
35
|
+
|
|
36
|
+
| Feature | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| 📦 **One-line dataset loading** | Load AI-ready datasets from the [Hugging Face Hub](https://huggingface.co/datasets) or local files with `load_dataset()` |
|
|
39
|
+
| 🔍 **Multiple formats** | Native support for CSV, JSON, JSONL, Parquet, Arrow, XML, Text, Webdataset, and more |
|
|
40
|
+
| 🖼️ **Multi-modal data** | Built-in support for text, audio, image, video, PDF, and NIfTI (3D medical) data |
|
|
41
|
+
| 🚀 **Streaming mode** | Stream datasets without downloading — iterate over data on-the-fly with `streaming=True` (now up to **100x faster** with Xet backend) |
|
|
42
|
+
| 💾 **HF Storage Buckets** | Read and write directly from/to [Hugging Face Storage Buckets](https://huggingface.co/docs/hub/storage-buckets) for mutable, large-scale raw data |
|
|
43
|
+
| 🧠 **AI Agent Traces** | Load and process AI agent traces (prompts, tool calls, responses) from the Hub |
|
|
44
|
+
| ⚡ **Apache Arrow backend** | Zero-copy memory-mapped storage — datasets naturally free you from RAM limitations |
|
|
45
|
+
| 🔄 **Smart caching** | Never wait for your data to process twice — cached results are automatically reused |
|
|
46
|
+
| 📊 **Multi-framework interoperability** | Native conversion to/from NumPy, Pandas, Polars, Arrow, PyTorch, TensorFlow, JAX, and Spark |
|
|
47
|
+
| 🏎️ **Multi-processing** | Fast parallel data processing with `map(num_proc=N)` |
|
|
48
|
+
| 🔎 **Search & index** | Built-in FAISS and Elasticsearch index support for similarity search |
|
|
49
|
+
| 📦 **JSON type** | Flexible JSON/structured data support with `Json()` feature type |
|
|
44
50
|
|
|
45
51
|
# Installation
|
|
46
52
|
|
|
47
53
|
## With pip
|
|
48
54
|
|
|
49
|
-
🤗 Datasets can be installed from PyPi and
|
|
55
|
+
🤗 Datasets can be installed from PyPi and should be installed in a virtual environment (venv or conda for instance):
|
|
50
56
|
|
|
51
57
|
```bash
|
|
52
58
|
pip install datasets
|
|
53
59
|
```
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
For the latest development version:
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
```bash
|
|
64
|
+
pip install "datasets @ git+https://github.com/huggingface/datasets.git"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## With conda
|
|
58
68
|
|
|
59
69
|
```bash
|
|
60
70
|
conda install -c huggingface -c conda-forge datasets
|
|
61
71
|
```
|
|
62
72
|
|
|
63
|
-
|
|
73
|
+
## Optional dependencies
|
|
74
|
+
|
|
75
|
+
🤗 Datasets supports various optional features via extras:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# For audio (torchcodec)
|
|
79
|
+
pip install datasets[audio]
|
|
64
80
|
|
|
65
|
-
For
|
|
81
|
+
# For image/video (Pillow, torchcodec)
|
|
82
|
+
pip install datasets[vision]
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
# For PDFs/NIfTI (pdfplumber, nibabel)
|
|
85
|
+
pip install datasets[pdfs,nibabel]
|
|
68
86
|
|
|
69
|
-
|
|
70
|
-
|
|
87
|
+
# For PyTorch/TensorFlow/JAX integration
|
|
88
|
+
pip install datasets[torch,tensorflow,jax]
|
|
71
89
|
|
|
72
|
-
|
|
90
|
+
```
|
|
73
91
|
|
|
74
|
-
|
|
92
|
+
For more details on installation, check the [installation page](https://huggingface.co/docs/datasets/installation).
|
|
75
93
|
|
|
76
|
-
|
|
94
|
+
# Quick Start
|
|
77
95
|
|
|
78
|
-
|
|
96
|
+
🤗 Datasets is made to be very simple to use — the API is centered around a single function, `datasets.load_dataset(dataset_name, **kwargs)`, that instantiates a dataset.
|
|
79
97
|
|
|
80
98
|
Here is a quick example:
|
|
81
99
|
|
|
82
100
|
```python
|
|
83
101
|
from datasets import load_dataset
|
|
84
102
|
|
|
85
|
-
# Print all the available datasets
|
|
86
|
-
from huggingface_hub import list_datasets
|
|
87
|
-
print([dataset.id for dataset in list_datasets(limit=20)])
|
|
88
|
-
|
|
89
103
|
# Load a dataset and print the first example in the training set
|
|
90
104
|
squad_dataset = load_dataset('rajpurkar/squad')
|
|
91
105
|
print(squad_dataset['train'][0])
|
|
@@ -93,32 +107,118 @@ print(squad_dataset['train'][0])
|
|
|
93
107
|
# Process the dataset - add a column with the length of the context texts
|
|
94
108
|
dataset_with_length = squad_dataset.map(lambda x: {"length": len(x["context"])})
|
|
95
109
|
|
|
96
|
-
#
|
|
110
|
+
# Tokenize the context texts (using a tokenizer from the 🤗 Transformers library)
|
|
97
111
|
from transformers import AutoTokenizer
|
|
98
112
|
tokenizer = AutoTokenizer.from_pretrained('bert-base-cased')
|
|
99
113
|
|
|
100
114
|
tokenized_dataset = squad_dataset.map(lambda x: tokenizer(x['context']), batched=True)
|
|
115
|
+
|
|
116
|
+
# Tokenize chat conversations with a chat template (using a model that supports chat templates)
|
|
117
|
+
# This is useful for fine-tuning instruction/chat models
|
|
118
|
+
|
|
119
|
+
# Load a popular chat dataset (ultrachat_200k contains ~200k AI assistant conversations)
|
|
120
|
+
chat_dataset = load_dataset('HuggingFaceH4/ultrachat_200k', split='train_sft')
|
|
121
|
+
|
|
122
|
+
chat_tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen2.5-7B-Instruct')
|
|
123
|
+
|
|
124
|
+
def tokenize_chat(examples):
|
|
125
|
+
# Apply the chat template and tokenize in one step
|
|
126
|
+
return chat_tokenizer.apply_chat_template(examples["messages"])
|
|
127
|
+
|
|
128
|
+
tokenized_chat_dataset = chat_dataset.map(tokenize_chat, batched=True)
|
|
101
129
|
```
|
|
102
130
|
|
|
131
|
+
## Streaming mode
|
|
132
|
+
|
|
103
133
|
If your dataset is bigger than your disk or if you don't want to wait to download the data, you can use streaming:
|
|
104
134
|
|
|
105
135
|
```python
|
|
106
|
-
#
|
|
136
|
+
# Stream the dataset without downloading anything
|
|
107
137
|
image_dataset = load_dataset('timm/imagenet-1k-wds', streaming=True)
|
|
108
138
|
for example in image_dataset["train"]:
|
|
139
|
+
print(example["image"])
|
|
109
140
|
break
|
|
110
141
|
```
|
|
111
142
|
|
|
112
|
-
|
|
143
|
+
## Multi-modal data
|
|
113
144
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
145
|
+
🤗 Datasets supports a wide variety of data types out of the box:
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
# Audio dataset
|
|
149
|
+
dataset = load_dataset("openslr/librispeech_asr", "clean")
|
|
150
|
+
|
|
151
|
+
# Image dataset
|
|
152
|
+
dataset = load_dataset("ILSVRC/imagenet-1k")
|
|
153
|
+
|
|
154
|
+
# Video dataset
|
|
155
|
+
dataset = load_dataset("Shofo/shofo-tiktok-general-small")
|
|
156
|
+
|
|
157
|
+
# PDF documents
|
|
158
|
+
dataset = load_dataset("pixparse/pdfa-eng-wds")
|
|
159
|
+
|
|
160
|
+
# NIfTI (3D medical imaging)
|
|
161
|
+
dataset = load_dataset("dartbrains/localizer", "betas")
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## From local files
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
# Load from local CSV
|
|
168
|
+
dataset = load_dataset('csv', data_files='my_data.csv')
|
|
169
|
+
|
|
170
|
+
# Load from local Parquet
|
|
171
|
+
dataset = load_dataset('parquet', data_files='data/*.parquet')
|
|
172
|
+
|
|
173
|
+
# Load from a local directory (auto-detect format)
|
|
174
|
+
dataset = load_dataset('./path/to/data')
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## From Python objects
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
from datasets import Dataset
|
|
181
|
+
|
|
182
|
+
# From a dictionary
|
|
183
|
+
dataset = Dataset.from_dict({"text": ["Hello world", "How are you?"]})
|
|
184
|
+
|
|
185
|
+
# From a list
|
|
186
|
+
dataset = Dataset.from_list([{"text": "Hello world"}, {"text": "How are you?"}])
|
|
187
|
+
|
|
188
|
+
# From Pandas
|
|
189
|
+
import pandas as pd
|
|
190
|
+
df = pd.DataFrame({"col1": [1, 2, 3], "col2": ["a", "b", "c"]})
|
|
191
|
+
dataset = Dataset.from_pandas(df)
|
|
192
|
+
|
|
193
|
+
# From a generator
|
|
194
|
+
def gen():
|
|
195
|
+
for i in range(10):
|
|
196
|
+
yield {"value": i}
|
|
197
|
+
dataset = Dataset.from_generator(gen)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
For more details on using the library, check the [quick start guide](https://huggingface.co/docs/datasets/quickstart) and the specific pages on:
|
|
201
|
+
|
|
202
|
+
- [Loading a dataset](https://huggingface.co/docs/datasets/loading)
|
|
203
|
+
- [What's in a Dataset](https://huggingface.co/docs/datasets/access)
|
|
204
|
+
- [Processing data with 🤗 Datasets](https://huggingface.co/docs/datasets/process)
|
|
205
|
+
- [Processing audio data](https://huggingface.co/docs/datasets/audio_process)
|
|
206
|
+
- [Processing image data](https://huggingface.co/docs/datasets/image_process)
|
|
207
|
+
- [Processing text data](https://huggingface.co/docs/datasets/nlp_process)
|
|
208
|
+
- [Processing PDF data](https://huggingface.co/docs/datasets/pdf_process)
|
|
209
|
+
- [Processing video data](https://huggingface.co/docs/datasets/video_process)
|
|
210
|
+
- [Streaming a dataset](https://huggingface.co/docs/datasets/stream)
|
|
211
|
+
|
|
212
|
+
# Core Classes
|
|
213
|
+
|
|
214
|
+
The library provides two main dataset classes:
|
|
215
|
+
|
|
216
|
+
| Class | Description |
|
|
217
|
+
|-------|-------------|
|
|
218
|
+
| `Dataset` | In-memory / memory-mapped dataset backed by Apache Arrow. Supports indexing, slicing, random access and caching. |
|
|
219
|
+
| `IterableDataset` | Lazy, streamable dataset for large-scale / out-of-core processing. Supports streaming and infinite iteration. |
|
|
220
|
+
|
|
221
|
+
Both are wrapped in `DatasetDict` / `IterableDatasetDict` for multi-split datasets (e.g., train/test/val).
|
|
122
222
|
|
|
123
223
|
# Add a new dataset to the Hub
|
|
124
224
|
|
|
@@ -134,7 +234,16 @@ You can use 🤗 Datasets to load datasets based on versioned git repositories m
|
|
|
134
234
|
|
|
135
235
|
If you're a dataset owner and wish to update any part of it (description, citation, license, etc.), or do not want your dataset to be included in the Hugging Face Hub, please get in touch by opening a discussion or a pull request in the Community tab of the dataset page. Thanks for your contribution to the ML community!
|
|
136
236
|
|
|
137
|
-
|
|
237
|
+
# Contributing
|
|
238
|
+
|
|
239
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on:
|
|
240
|
+
|
|
241
|
+
- How to submit issues and pull requests
|
|
242
|
+
- Code style guidelines (we use [Ruff](https://docs.astral.sh/ruff/))
|
|
243
|
+
- Testing requirements
|
|
244
|
+
- Documentation standards
|
|
245
|
+
|
|
246
|
+
# BibTeX
|
|
138
247
|
|
|
139
248
|
If you want to cite our 🤗 Datasets library, you can use our [paper](https://huggingface.co/papers/2109.02846):
|
|
140
249
|
|