patching the builder for latest datasets
Browse files
darulm.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import os
|
2 |
import io
|
3 |
|
4 |
import zstandard
|
@@ -100,7 +99,7 @@ class DarulmConfig(datasets.BuilderConfig):
|
|
100 |
def __init__(self, domains="all", version=_VERSION, **kwargs):
|
101 |
"""BuilderConfig for DaruLM.
|
102 |
Args:
|
103 |
-
domains (str or list, default 'all'): domain names.
|
104 |
**kwargs: keyword arguments forwarded to super.
|
105 |
"""
|
106 |
if isinstance(domains, str):
|
@@ -150,13 +149,13 @@ class DarulmDataset(datasets.GeneratorBasedBuilder):
|
|
150 |
)
|
151 |
|
152 |
def _split_generators(self, dl_manager):
|
153 |
-
|
154 |
-
|
155 |
-
path for dn in self.config.domains for path in downloaded_files if f"_{dn}_" in path
|
156 |
]
|
|
|
157 |
return [
|
158 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={
|
159 |
-
"paths":
|
160 |
]
|
161 |
|
162 |
def _generate_examples(self, paths):
|
|
|
|
|
1 |
import io
|
2 |
|
3 |
import zstandard
|
|
|
99 |
def __init__(self, domains="all", version=_VERSION, **kwargs):
|
100 |
"""BuilderConfig for DaruLM.
|
101 |
Args:
|
102 |
+
domains (str or list, default 'all'): domain names.
|
103 |
**kwargs: keyword arguments forwarded to super.
|
104 |
"""
|
105 |
if isinstance(domains, str):
|
|
|
149 |
)
|
150 |
|
151 |
def _split_generators(self, dl_manager):
|
152 |
+
required_urls = [
|
153 |
+
path for dn in self.config.domains for path in _URLS if f"_{dn}_" in path
|
|
|
154 |
]
|
155 |
+
downloaded_files = dl_manager.download(required_urls)
|
156 |
return [
|
157 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={
|
158 |
+
"paths": downloaded_files}),
|
159 |
]
|
160 |
|
161 |
def _generate_examples(self, paths):
|