Update polygraph_xsum.py
Browse files- polygraph_xsum.py +2 -2
polygraph_xsum.py
CHANGED
|
@@ -44,7 +44,7 @@ class PolygraphXsum(datasets.GeneratorBasedBuilder):
|
|
| 44 |
def download_custom_dataset(src_url: str, dst_path: str):
|
| 45 |
split = src_url
|
| 46 |
x, y = _prepare_dataset(dataset[split])
|
| 47 |
-
result_dataset = Dataset.from_dict({"input": x, "output": y})
|
| 48 |
result_dataset.to_json(dst_path)
|
| 49 |
downloaded_files = dl_manager.download_custom(_SPLITS, download_custom_dataset)
|
| 50 |
|
|
@@ -69,6 +69,6 @@ class PolygraphXsum(datasets.GeneratorBasedBuilder):
|
|
| 69 |
|
| 70 |
def _generate_examples(self, filepath, lang):
|
| 71 |
with open(filepath, encoding="utf-8") as f:
|
| 72 |
-
dataset = Dataset.from_json(f.read())
|
| 73 |
for i in range(len(item)):
|
| 74 |
yield i, dataset[i]
|
|
|
|
| 44 |
def download_custom_dataset(src_url: str, dst_path: str):
|
| 45 |
split = src_url
|
| 46 |
x, y = _prepare_dataset(dataset[split])
|
| 47 |
+
result_dataset = datasets.Dataset.from_dict({"input": x, "output": y})
|
| 48 |
result_dataset.to_json(dst_path)
|
| 49 |
downloaded_files = dl_manager.download_custom(_SPLITS, download_custom_dataset)
|
| 50 |
|
|
|
|
| 69 |
|
| 70 |
def _generate_examples(self, filepath, lang):
|
| 71 |
with open(filepath, encoding="utf-8") as f:
|
| 72 |
+
dataset = datasets.Dataset.from_json(f.read())
|
| 73 |
for i in range(len(item)):
|
| 74 |
yield i, dataset[i]
|