Update polygraph_xsum.py
Browse files- polygraph_xsum.py +4 -5
polygraph_xsum.py
CHANGED
|
@@ -46,7 +46,7 @@ class PolygraphXsum(datasets.GeneratorBasedBuilder):
|
|
| 46 |
split = src_url
|
| 47 |
x, y = _prepare_dataset(dataset[split])
|
| 48 |
result_dataset = datasets.Dataset.from_dict({"input": x, "output": y})
|
| 49 |
-
result_dataset.
|
| 50 |
downloaded_files = dl_manager.download_custom({split: split for split in _CONFIG["splits"]}, download_custom_dataset)
|
| 51 |
|
| 52 |
return [
|
|
@@ -68,7 +68,6 @@ class PolygraphXsum(datasets.GeneratorBasedBuilder):
|
|
| 68 |
]
|
| 69 |
|
| 70 |
def _generate_examples(self, filepath):
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
yield i, dataset[i]
|
|
|
|
| 46 |
split = src_url
|
| 47 |
x, y = _prepare_dataset(dataset[split])
|
| 48 |
result_dataset = datasets.Dataset.from_dict({"input": x, "output": y})
|
| 49 |
+
result_dataset.save_to_disk(dst_path)
|
| 50 |
downloaded_files = dl_manager.download_custom({split: split for split in _CONFIG["splits"]}, download_custom_dataset)
|
| 51 |
|
| 52 |
return [
|
|
|
|
| 68 |
]
|
| 69 |
|
| 70 |
def _generate_examples(self, filepath):
|
| 71 |
+
dataset = datasets.Dataset.load_from_disk(filepath)
|
| 72 |
+
for i in range(len(item)):
|
| 73 |
+
yield i, dataset[i]
|
|
|