Upload nle_hf_dataset.py
Browse files- nle_hf_dataset.py +6 -2
nle_hf_dataset.py
CHANGED
|
@@ -106,8 +106,12 @@ class NleHfDataset(datasets.GeneratorBasedBuilder):
|
|
| 106 |
)
|
| 107 |
|
| 108 |
def _split_generators(self, dl_manager):
|
| 109 |
-
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
return [
|
| 112 |
datasets.SplitGenerator(
|
| 113 |
name=datasets.Split.TRAIN, gen_kwargs={"filepaths": filepaths})
|
|
|
|
| 106 |
)
|
| 107 |
|
| 108 |
def _split_generators(self, dl_manager):
|
| 109 |
+
if self.config.data_files is None:
|
| 110 |
+
urls = _URLS[self.config.name]
|
| 111 |
+
filepaths = [dl_manager.download(url) for url in urls]
|
| 112 |
+
else:
|
| 113 |
+
filepaths = self.config.data_files
|
| 114 |
+
|
| 115 |
return [
|
| 116 |
datasets.SplitGenerator(
|
| 117 |
name=datasets.Split.TRAIN, gen_kwargs={"filepaths": filepaths})
|