Datasets:
Fix get_patterns_in_dataset_repository error
Browse filesThere was a breaking change in the `get_patterns_in_dataset_repository` function causing
```py
TypeError: get_patterns_in_dataset_repository() missing 1 required positional argument: 'base_path'
```
You can fix that by simply not using it and providing the filenames explicitly.
The same fix was used in codeparrot/github-code:
https://huggingface.co/datasets/codeparrot/github-code/discussions/3
- code_clippy_github.py +6 -13
code_clippy_github.py
CHANGED
|
@@ -156,19 +156,12 @@ class CodeClippyGithub(datasets.GeneratorBasedBuilder):
|
|
| 156 |
)
|
| 157 |
|
| 158 |
def _split_generators(self, dl_manager):
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
patterns = datasets.data_files.get_patterns_in_dataset_repository(hfh_dataset_info)
|
| 166 |
-
data_files = datasets.data_files.DataFilesDict.from_hf_repo(
|
| 167 |
-
patterns,
|
| 168 |
-
dataset_info=hfh_dataset_info,
|
| 169 |
-
)
|
| 170 |
-
|
| 171 |
-
files = dl_manager.download_and_extract(data_files["train"])
|
| 172 |
return [
|
| 173 |
datasets.SplitGenerator(
|
| 174 |
name=datasets.Split.TRAIN,
|
|
|
|
| 156 |
)
|
| 157 |
|
| 158 |
def _split_generators(self, dl_manager):
|
| 159 |
+
num_shards = 50_000
|
| 160 |
+
data_files = [
|
| 161 |
+
f"github-dedup-{_index:012d}.json.gz"
|
| 162 |
+
for _index in range(num_shards)
|
| 163 |
+
]
|
| 164 |
+
files = dl_manager.download(data_files)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
return [
|
| 166 |
datasets.SplitGenerator(
|
| 167 |
name=datasets.Split.TRAIN,
|