brthor commited on
Commit
784858e
·
verified ·
1 Parent(s): 20d4514

Add usage snippet for concatenating all configs

Browse files
Files changed (1) hide show
  1. README.md +29 -1
README.md CHANGED
@@ -84,7 +84,9 @@ Each dataset config exposes a single split named `train`.
84
  - `test_clean_large` (`train`): 107.5 hours of speech. 72 speakers averaging 1.49 hours per speaker.
85
  - `test_other_large` (`train`): 100.3 hours of speech. 73 speakers averaging 1.37 hours per speaker.
86
 
87
- ## Loading a Single Config
 
 
88
 
89
  ```python
90
  from datasets import load_dataset
@@ -94,6 +96,32 @@ small = load_dataset("mythicinfinity/libriheavy", "small", split="train")
94
 
95
  Targeting a specific config only downloads files declared for that config, which is a good way to control disk usage.
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  ## Citation
98
 
99
  ```bibtex
 
84
  - `test_clean_large` (`train`): 107.5 hours of speech. 72 speakers averaging 1.49 hours per speaker.
85
  - `test_other_large` (`train`): 100.3 hours of speech. 73 speakers averaging 1.37 hours per speaker.
86
 
87
+ ## Usage
88
+
89
+ ### Load a Single Config
90
 
91
  ```python
92
  from datasets import load_dataset
 
96
 
97
  Targeting a specific config only downloads files declared for that config, which is a good way to control disk usage.
98
 
99
+ ### Load the Full Dataset (All Configs)
100
+
101
+ ```python
102
+ from datasets import concatenate_datasets, load_dataset
103
+
104
+ ALL_CONFIGS = [
105
+ "small",
106
+ "medium",
107
+ "large",
108
+ "dev",
109
+ "test_clean",
110
+ "test_clean_large",
111
+ "test_other",
112
+ "test_other_large",
113
+ ]
114
+
115
+
116
+ def load_libriheavy_all_train(configs: list[str] | None = None):
117
+ cfgs = configs or ALL_CONFIGS
118
+ parts = [load_dataset("mythicinfinity/libriheavy", cfg, split="train") for cfg in cfgs]
119
+ return concatenate_datasets(parts)
120
+
121
+
122
+ full = load_libriheavy_all_train()
123
+ ```
124
+
125
  ## Citation
126
 
127
  ```bibtex