Commit
·
1f75968
1
Parent(s):
32b0700
Upload TimeIT.py
Browse files
TimeIT.py
CHANGED
|
@@ -178,51 +178,23 @@ class TimeITDataset(datasets.GeneratorBasedBuilder):
|
|
| 178 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
| 179 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 180 |
urls = _URLS[self.config.name]
|
| 181 |
-
print("urls: ", urls)
|
| 182 |
data_dir = dl_manager.download_and_extract(urls) # a dict string
|
| 183 |
ret = []
|
| 184 |
# control the choice of the instruction
|
| 185 |
random.seed(_SEED)
|
| 186 |
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
datasets.
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
},
|
| 198 |
-
)
|
| 199 |
-
)
|
| 200 |
-
if "val" in data_dir:
|
| 201 |
-
ret.append(
|
| 202 |
-
datasets.SplitGenerator(
|
| 203 |
-
name=datasets.Split.VALIDATION,
|
| 204 |
-
# These kwargs will be passed to _generate_examples
|
| 205 |
-
gen_kwargs={
|
| 206 |
-
"filepath": data_dir["val"],
|
| 207 |
-
"split": "dev",
|
| 208 |
-
"instruction_path": data_dir["instruction"],
|
| 209 |
-
"data_dir": data_dir,
|
| 210 |
-
},
|
| 211 |
-
)
|
| 212 |
-
)
|
| 213 |
-
if "test" in data_dir:
|
| 214 |
-
ret.append(
|
| 215 |
-
datasets.SplitGenerator(
|
| 216 |
-
name=datasets.Split.TEST,
|
| 217 |
-
# These kwargs will be passed to _generate_examples
|
| 218 |
-
gen_kwargs={
|
| 219 |
-
"filepath": data_dir["test"],
|
| 220 |
-
"split": "test",
|
| 221 |
-
"instruction_path": data_dir["instruction"],
|
| 222 |
-
"data_dir": data_dir,
|
| 223 |
-
},
|
| 224 |
-
)
|
| 225 |
)
|
|
|
|
| 226 |
return ret
|
| 227 |
|
| 228 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
|
|
|
| 178 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
| 179 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 180 |
urls = _URLS[self.config.name]
|
|
|
|
| 181 |
data_dir = dl_manager.download_and_extract(urls) # a dict string
|
| 182 |
ret = []
|
| 183 |
# control the choice of the instruction
|
| 184 |
random.seed(_SEED)
|
| 185 |
|
| 186 |
+
ret.append(
|
| 187 |
+
datasets.SplitGenerator(
|
| 188 |
+
name=datasets.Split.TRAIN,
|
| 189 |
+
# These kwargs will be passed to _generate_examples
|
| 190 |
+
gen_kwargs={
|
| 191 |
+
"filepath": data_dir["train"],
|
| 192 |
+
"split": "train",
|
| 193 |
+
"instruction_path": data_dir["instruction"],
|
| 194 |
+
"data_dir": data_dir,
|
| 195 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
)
|
| 197 |
+
)
|
| 198 |
return ret
|
| 199 |
|
| 200 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|