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.
Files changed (194) hide show
  1. {datasets-4.8.4/src/datasets.egg-info → datasets-5.0.0}/PKG-INFO +166 -44
  2. {datasets-4.8.4 → datasets-5.0.0}/README.md +151 -42
  3. {datasets-4.8.4 → datasets-5.0.0}/setup.py +13 -2
  4. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/__init__.py +1 -1
  5. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/arrow_dataset.py +64 -18
  6. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/arrow_writer.py +16 -3
  7. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/builder.py +53 -105
  8. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/test.py +1 -1
  9. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/config.py +6 -1
  10. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/dataset_dict.py +5 -5
  11. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/download_manager.py +2 -2
  12. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/__init__.py +2 -0
  13. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/audio.py +34 -5
  14. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/features.py +14 -4
  15. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/image.py +34 -5
  16. datasets-5.0.0/src/datasets/features/mesh.py +295 -0
  17. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/nifti.py +34 -5
  18. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/pdf.py +34 -5
  19. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/video.py +34 -5
  20. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/hub.py +13 -2
  21. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/info.py +13 -3
  22. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/csv.py +1 -3
  23. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/generator.py +1 -3
  24. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/json.py +8 -4
  25. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/parquet.py +1 -3
  26. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/sql.py +1 -3
  27. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/text.py +1 -3
  28. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/iterable_dataset.py +352 -127
  29. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/load.py +20 -10
  30. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/__init__.py +18 -0
  31. datasets-5.0.0/src/datasets/packaged_modules/conll/conll.py +155 -0
  32. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py +3 -2
  33. datasets-5.0.0/src/datasets/packaged_modules/iceberg/iceberg.py +173 -0
  34. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/json/json.py +227 -5
  35. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/lance/lance.py +2 -1
  36. datasets-5.0.0/src/datasets/packaged_modules/meshfolder/meshfolder.py +31 -0
  37. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/parquet/parquet.py +41 -24
  38. datasets-5.0.0/src/datasets/packaged_modules/tsfile/tsfile.py +773 -0
  39. datasets-5.0.0/src/datasets/packaged_modules/videofolder/__init__.py +0 -0
  40. datasets-5.0.0/src/datasets/packaged_modules/webdataset/__init__.py +0 -0
  41. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/webdataset/webdataset.py +19 -1
  42. datasets-5.0.0/src/datasets/packaged_modules/xml/__init__.py +0 -0
  43. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/splits.py +10 -0
  44. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/table.py +102 -5
  45. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/file_utils.py +8 -1
  46. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/info_utils.py +1 -1
  47. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/json.py +28 -8
  48. datasets-5.0.0/src/datasets/utils/resources/__init__.py +0 -0
  49. {datasets-4.8.4 → datasets-5.0.0/src/datasets.egg-info}/PKG-INFO +166 -44
  50. {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/SOURCES.txt +9 -0
  51. {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/requires.txt +16 -1
  52. {datasets-4.8.4 → datasets-5.0.0}/tests/test_arrow_dataset.py +239 -0
  53. {datasets-4.8.4 → datasets-5.0.0}/tests/test_builder.py +47 -314
  54. {datasets-4.8.4 → datasets-5.0.0}/tests/test_inspect.py +9 -5
  55. {datasets-4.8.4 → datasets-5.0.0}/tests/test_iterable_dataset.py +235 -18
  56. {datasets-4.8.4 → datasets-5.0.0}/tests/test_load.py +6 -6
  57. {datasets-4.8.4 → datasets-5.0.0}/tests/test_offline_util.py +4 -4
  58. {datasets-4.8.4 → datasets-5.0.0}/tests/test_tqdm.py +2 -2
  59. {datasets-4.8.4 → datasets-5.0.0}/AUTHORS +0 -0
  60. {datasets-4.8.4 → datasets-5.0.0}/LICENSE +0 -0
  61. {datasets-4.8.4 → datasets-5.0.0}/pyproject.toml +0 -0
  62. {datasets-4.8.4 → datasets-5.0.0}/setup.cfg +0 -0
  63. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/arrow_reader.py +0 -0
  64. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/combine.py +0 -0
  65. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/__init__.py +0 -0
  66. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/datasets_cli.py +0 -0
  67. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/delete_from_hub.py +0 -0
  68. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/commands/env.py +0 -0
  69. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/data_files.py +0 -0
  70. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/distributed.py +0 -0
  71. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/__init__.py +0 -0
  72. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/download_config.py +0 -0
  73. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/download/streaming_download_manager.py +0 -0
  74. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/exceptions.py +0 -0
  75. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/_torchcodec.py +0 -0
  76. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/features/translation.py +0 -0
  77. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/filesystems/__init__.py +0 -0
  78. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/filesystems/compression.py +0 -0
  79. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/fingerprint.py +0 -0
  80. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/__init__.py +0 -0
  81. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/formatting.py +0 -0
  82. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/jax_formatter.py +0 -0
  83. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/np_formatter.py +0 -0
  84. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/polars_formatter.py +0 -0
  85. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/tf_formatter.py +0 -0
  86. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/formatting/torch_formatter.py +0 -0
  87. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/inspect.py +0 -0
  88. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/__init__.py +0 -0
  89. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/abc.py +0 -0
  90. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/io/spark.py +0 -0
  91. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/naming.py +0 -0
  92. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/arrow/__init__.py +0 -0
  93. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/arrow/arrow.py +0 -0
  94. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/audiofolder/__init__.py +0 -0
  95. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/audiofolder/audiofolder.py +0 -0
  96. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/cache/__init__.py +0 -0
  97. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/cache/cache.py +0 -0
  98. {datasets-4.8.4/src/datasets/packaged_modules/csv → datasets-5.0.0/src/datasets/packaged_modules/conll}/__init__.py +0 -0
  99. {datasets-4.8.4/src/datasets/packaged_modules/eval → datasets-5.0.0/src/datasets/packaged_modules/csv}/__init__.py +0 -0
  100. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/csv/csv.py +0 -0
  101. {datasets-4.8.4/src/datasets/packaged_modules/folder_based_builder → datasets-5.0.0/src/datasets/packaged_modules/eval}/__init__.py +0 -0
  102. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/eval/eval.py +0 -0
  103. {datasets-4.8.4/src/datasets/packaged_modules/generator → datasets-5.0.0/src/datasets/packaged_modules/folder_based_builder}/__init__.py +0 -0
  104. {datasets-4.8.4/src/datasets/packaged_modules/hdf5 → datasets-5.0.0/src/datasets/packaged_modules/generator}/__init__.py +0 -0
  105. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/generator/generator.py +0 -0
  106. {datasets-4.8.4/src/datasets/packaged_modules/imagefolder → datasets-5.0.0/src/datasets/packaged_modules/hdf5}/__init__.py +0 -0
  107. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/hdf5/hdf5.py +0 -0
  108. {datasets-4.8.4/src/datasets/packaged_modules/json → datasets-5.0.0/src/datasets/packaged_modules/iceberg}/__init__.py +0 -0
  109. {datasets-4.8.4/src/datasets/packaged_modules/lance → datasets-5.0.0/src/datasets/packaged_modules/imagefolder}/__init__.py +0 -0
  110. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/imagefolder/imagefolder.py +0 -0
  111. {datasets-4.8.4/src/datasets/packaged_modules/niftifolder → datasets-5.0.0/src/datasets/packaged_modules/json}/__init__.py +0 -0
  112. {datasets-4.8.4/src/datasets/packaged_modules/pandas → datasets-5.0.0/src/datasets/packaged_modules/lance}/__init__.py +0 -0
  113. {datasets-4.8.4/src/datasets/packaged_modules/parquet → datasets-5.0.0/src/datasets/packaged_modules/meshfolder}/__init__.py +0 -0
  114. {datasets-4.8.4/src/datasets/packaged_modules/pdffolder → datasets-5.0.0/src/datasets/packaged_modules/niftifolder}/__init__.py +0 -0
  115. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/niftifolder/niftifolder.py +0 -0
  116. {datasets-4.8.4/src/datasets/packaged_modules/spark → datasets-5.0.0/src/datasets/packaged_modules/pandas}/__init__.py +0 -0
  117. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/pandas/pandas.py +0 -0
  118. {datasets-4.8.4/src/datasets/packaged_modules/sql → datasets-5.0.0/src/datasets/packaged_modules/parquet}/__init__.py +0 -0
  119. {datasets-4.8.4/src/datasets/packaged_modules/text → datasets-5.0.0/src/datasets/packaged_modules/pdffolder}/__init__.py +0 -0
  120. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/pdffolder/pdffolder.py +0 -0
  121. {datasets-4.8.4/src/datasets/packaged_modules/videofolder → datasets-5.0.0/src/datasets/packaged_modules/spark}/__init__.py +0 -0
  122. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/spark/spark.py +0 -0
  123. {datasets-4.8.4/src/datasets/packaged_modules/webdataset → datasets-5.0.0/src/datasets/packaged_modules/sql}/__init__.py +0 -0
  124. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/sql/sql.py +0 -0
  125. {datasets-4.8.4/src/datasets/packaged_modules/xml → datasets-5.0.0/src/datasets/packaged_modules/text}/__init__.py +0 -0
  126. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/text/text.py +0 -0
  127. {datasets-4.8.4/src/datasets/utils/resources → datasets-5.0.0/src/datasets/packaged_modules/tsfile}/__init__.py +0 -0
  128. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/videofolder/videofolder.py +0 -0
  129. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/webdataset/_tenbin.py +0 -0
  130. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/packaged_modules/xml/xml.py +0 -0
  131. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/parallel/__init__.py +0 -0
  132. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/parallel/parallel.py +0 -0
  133. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/search.py +0 -0
  134. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/streaming.py +0 -0
  135. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/__init__.py +0 -0
  136. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/_dataset_viewer.py +0 -0
  137. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/_dill.py +0 -0
  138. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/_filelock.py +0 -0
  139. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/deprecation_utils.py +0 -0
  140. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/doc_utils.py +0 -0
  141. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/experimental.py +0 -0
  142. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/extract.py +0 -0
  143. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/filelock.py +0 -0
  144. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/hub.py +0 -0
  145. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/logging.py +0 -0
  146. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/metadata.py +0 -0
  147. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/patching.py +0 -0
  148. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/py_utils.py +0 -0
  149. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/creators.json +0 -0
  150. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/languages.json +0 -0
  151. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/multilingualities.json +0 -0
  152. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/readme_structure.yaml +0 -0
  153. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/resources/size_categories.json +0 -0
  154. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/sharding.py +0 -0
  155. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/stratify.py +0 -0
  156. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/tf_utils.py +0 -0
  157. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/tqdm.py +0 -0
  158. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/track.py +0 -0
  159. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/typing.py +0 -0
  160. {datasets-4.8.4 → datasets-5.0.0}/src/datasets/utils/version.py +0 -0
  161. {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/dependency_links.txt +0 -0
  162. {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/entry_points.txt +0 -0
  163. {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/not-zip-safe +0 -0
  164. {datasets-4.8.4 → datasets-5.0.0}/src/datasets.egg-info/top_level.txt +0 -0
  165. {datasets-4.8.4 → datasets-5.0.0}/tests/test_arrow_reader.py +0 -0
  166. {datasets-4.8.4 → datasets-5.0.0}/tests/test_arrow_writer.py +0 -0
  167. {datasets-4.8.4 → datasets-5.0.0}/tests/test_data_files.py +0 -0
  168. {datasets-4.8.4 → datasets-5.0.0}/tests/test_dataset_dict.py +0 -0
  169. {datasets-4.8.4 → datasets-5.0.0}/tests/test_dataset_list.py +0 -0
  170. {datasets-4.8.4 → datasets-5.0.0}/tests/test_distributed.py +0 -0
  171. {datasets-4.8.4 → datasets-5.0.0}/tests/test_download_manager.py +0 -0
  172. {datasets-4.8.4 → datasets-5.0.0}/tests/test_exceptions.py +0 -0
  173. {datasets-4.8.4 → datasets-5.0.0}/tests/test_experimental.py +0 -0
  174. {datasets-4.8.4 → datasets-5.0.0}/tests/test_extract.py +0 -0
  175. {datasets-4.8.4 → datasets-5.0.0}/tests/test_file_utils.py +0 -0
  176. {datasets-4.8.4 → datasets-5.0.0}/tests/test_filelock.py +0 -0
  177. {datasets-4.8.4 → datasets-5.0.0}/tests/test_filesystem.py +0 -0
  178. {datasets-4.8.4 → datasets-5.0.0}/tests/test_fingerprint.py +0 -0
  179. {datasets-4.8.4 → datasets-5.0.0}/tests/test_fingerprint_tokenizer_stability.py +0 -0
  180. {datasets-4.8.4 → datasets-5.0.0}/tests/test_formatting.py +0 -0
  181. {datasets-4.8.4 → datasets-5.0.0}/tests/test_hub.py +0 -0
  182. {datasets-4.8.4 → datasets-5.0.0}/tests/test_info.py +0 -0
  183. {datasets-4.8.4 → datasets-5.0.0}/tests/test_info_utils.py +0 -0
  184. {datasets-4.8.4 → datasets-5.0.0}/tests/test_metadata_util.py +0 -0
  185. {datasets-4.8.4 → datasets-5.0.0}/tests/test_parallel.py +0 -0
  186. {datasets-4.8.4 → datasets-5.0.0}/tests/test_patching.py +0 -0
  187. {datasets-4.8.4 → datasets-5.0.0}/tests/test_py_utils.py +0 -0
  188. {datasets-4.8.4 → datasets-5.0.0}/tests/test_search.py +0 -0
  189. {datasets-4.8.4 → datasets-5.0.0}/tests/test_sharding_utils.py +0 -0
  190. {datasets-4.8.4 → datasets-5.0.0}/tests/test_splits.py +0 -0
  191. {datasets-4.8.4 → datasets-5.0.0}/tests/test_streaming_download_manager.py +0 -0
  192. {datasets-4.8.4 → datasets-5.0.0}/tests/test_table.py +0 -0
  193. {datasets-4.8.4 → datasets-5.0.0}/tests/test_upstream_hub.py +0 -0
  194. {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: 4.8.4
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.2.0,>=2023.1.0
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 ![number of datasets](https://img.shields.io/endpoint?url=https://huggingface.co/api/shields/datasets&color=brightgreen) 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, Parquet, HDF5, etc. With simple commands like `processed_dataset = dataset.map(process_example)`, efficiently prepare the dataset for inspection and ML model evaluation and training.
224
+ - **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the ![number of datasets](https://img.shields.io/endpoint?url=https://huggingface.co/api/shields/datasets&color=brightgreen) 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
- 🤗 Datasets is designed to let the community easily add and share new datasets.
221
-
222
- 🤗 Datasets has many additional interesting features:
223
-
224
- - Thrive on large datasets: 🤗 Datasets naturally frees the user from RAM memory limitation, all datasets are memory-mapped using an efficient zero-serialization cost backend (Apache Arrow).
225
- - Smart caching: never wait for your data to process several times.
226
- - Lightweight and fast with a transparent and pythonic API (multi-processing/caching/memory-mapping).
227
- - Built-in interoperability with NumPy, PyTorch, TensorFlow 2, JAX, Pandas, Polars and more.
228
- - Native support for audio, image and video data.
229
- - Enable streaming mode to save disk space and start iterating over the dataset immediately.
230
-
231
- 🤗 Datasets originated from a fork of the awesome [TensorFlow Datasets](https://github.com/tensorflow/datasets) and the HuggingFace team want to deeply thank the TensorFlow Datasets team for building this amazing library.
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 has to be installed in a virtual environment (venv or conda for instance)
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
- ## With conda
262
+ For the latest development version:
244
263
 
245
- 🤗 Datasets can be installed using conda as follows:
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
- Follow the installation pages of TensorFlow and PyTorch to see how to install them with conda.
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 more details on installation, check the installation page in the documentation: https://huggingface.co/docs/datasets/installation
282
+ # For image/video (Pillow, torchcodec)
283
+ pip install datasets[vision]
254
284
 
255
- ## Installation to use with Machine Learning & Data frameworks frameworks
285
+ # For PDFs/NIfTI (pdfplumber, nibabel)
286
+ pip install datasets[pdfs,nibabel]
256
287
 
257
- If you plan to use 🤗 Datasets with PyTorch (2.0+), TensorFlow (2.6+) or JAX (0.4+) you should also install PyTorch, TensorFlow or JAX.
258
- 🤗 Datasets is also well integrated with data frameworks like PyArrow, Pandas, Polars and Spark, which should be installed separately.
288
+ # For PyTorch/TensorFlow/JAX integration
289
+ pip install datasets[torch,tensorflow,jax]
259
290
 
260
- For more details on using the library with these frameworks, check the quick start page in the documentation: https://huggingface.co/docs/datasets/quickstart
291
+ ```
261
292
 
262
- # Usage
293
+ For more details on installation, check the [installation page](https://huggingface.co/docs/datasets/installation).
263
294
 
264
- 🤗 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.
295
+ # Quick Start
265
296
 
266
- This library can be used for text/image/audio/etc. datasets. Here is an example to load a text dataset:
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
- # Process the dataset - tokenize the context texts (using a tokenizer from the 🤗 Transformers library)
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
- # If you want to use the dataset immediately and efficiently stream the data as you iterate over the dataset
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
- For more details on using the library, check the quick start page in the documentation: https://huggingface.co/docs/datasets/quickstart and the specific pages on:
344
+ ## Multi-modal data
301
345
 
302
- - Loading a dataset: https://huggingface.co/docs/datasets/loading
303
- - What's in a Dataset: https://huggingface.co/docs/datasets/access
304
- - Processing data with 🤗 Datasets: https://huggingface.co/docs/datasets/process
305
- - Processing audio data: https://huggingface.co/docs/datasets/audio_process
306
- - Processing image data: https://huggingface.co/docs/datasets/image_process
307
- - Processing text data: https://huggingface.co/docs/datasets/nlp_process
308
- - Streaming a dataset: https://huggingface.co/docs/datasets/stream
309
- - etc.
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
- ## BibTeX
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 ![number of datasets](https://img.shields.io/endpoint?url=https://huggingface.co/api/shields/datasets&color=brightgreen) 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, Parquet, HDF5, etc. With simple commands like `processed_dataset = dataset.map(process_example)`, efficiently prepare the dataset for inspection and ML model evaluation and training.
23
+ - **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the ![number of datasets](https://img.shields.io/endpoint?url=https://huggingface.co/api/shields/datasets&color=brightgreen) 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
- 🤗 Datasets is designed to let the community easily add and share new datasets.
33
-
34
- 🤗 Datasets has many additional interesting features:
35
-
36
- - Thrive on large datasets: 🤗 Datasets naturally frees the user from RAM memory limitation, all datasets are memory-mapped using an efficient zero-serialization cost backend (Apache Arrow).
37
- - Smart caching: never wait for your data to process several times.
38
- - Lightweight and fast with a transparent and pythonic API (multi-processing/caching/memory-mapping).
39
- - Built-in interoperability with NumPy, PyTorch, TensorFlow 2, JAX, Pandas, Polars and more.
40
- - Native support for audio, image and video data.
41
- - Enable streaming mode to save disk space and start iterating over the dataset immediately.
42
-
43
- 🤗 Datasets originated from a fork of the awesome [TensorFlow Datasets](https://github.com/tensorflow/datasets) and the HuggingFace team want to deeply thank the TensorFlow Datasets team for building this amazing library.
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 has to be installed in a virtual environment (venv or conda for instance)
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
- ## With conda
61
+ For the latest development version:
56
62
 
57
- 🤗 Datasets can be installed using conda as follows:
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
- Follow the installation pages of TensorFlow and PyTorch to see how to install them with conda.
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 more details on installation, check the installation page in the documentation: https://huggingface.co/docs/datasets/installation
81
+ # For image/video (Pillow, torchcodec)
82
+ pip install datasets[vision]
66
83
 
67
- ## Installation to use with Machine Learning & Data frameworks frameworks
84
+ # For PDFs/NIfTI (pdfplumber, nibabel)
85
+ pip install datasets[pdfs,nibabel]
68
86
 
69
- If you plan to use 🤗 Datasets with PyTorch (2.0+), TensorFlow (2.6+) or JAX (0.4+) you should also install PyTorch, TensorFlow or JAX.
70
- 🤗 Datasets is also well integrated with data frameworks like PyArrow, Pandas, Polars and Spark, which should be installed separately.
87
+ # For PyTorch/TensorFlow/JAX integration
88
+ pip install datasets[torch,tensorflow,jax]
71
89
 
72
- For more details on using the library with these frameworks, check the quick start page in the documentation: https://huggingface.co/docs/datasets/quickstart
90
+ ```
73
91
 
74
- # Usage
92
+ For more details on installation, check the [installation page](https://huggingface.co/docs/datasets/installation).
75
93
 
76
- 🤗 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.
94
+ # Quick Start
77
95
 
78
- This library can be used for text/image/audio/etc. datasets. Here is an example to load a text dataset:
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
- # Process the dataset - tokenize the context texts (using a tokenizer from the 🤗 Transformers library)
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
- # If you want to use the dataset immediately and efficiently stream the data as you iterate over the dataset
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
- For more details on using the library, check the quick start page in the documentation: https://huggingface.co/docs/datasets/quickstart and the specific pages on:
143
+ ## Multi-modal data
113
144
 
114
- - Loading a dataset: https://huggingface.co/docs/datasets/loading
115
- - What's in a Dataset: https://huggingface.co/docs/datasets/access
116
- - Processing data with 🤗 Datasets: https://huggingface.co/docs/datasets/process
117
- - Processing audio data: https://huggingface.co/docs/datasets/audio_process
118
- - Processing image data: https://huggingface.co/docs/datasets/image_process
119
- - Processing text data: https://huggingface.co/docs/datasets/nlp_process
120
- - Streaming a dataset: https://huggingface.co/docs/datasets/stream
121
- - etc.
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
- ## BibTeX
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