update sharding
Browse files- ukrainian-news.py +5 -5
ukrainian-news.py
CHANGED
@@ -45,17 +45,17 @@ class UkrainianNews(datasets.GeneratorBasedBuilder):
|
|
45 |
)
|
46 |
|
47 |
def _split_generators(self, dl_manager):
|
48 |
-
downloaded_files = dl_manager.
|
49 |
|
50 |
return [
|
51 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"
|
52 |
]
|
53 |
|
54 |
-
def _generate_examples(self,
|
55 |
"""This function returns the examples in the raw (text) form."""
|
56 |
-
logger.info("generating examples from = %s",
|
57 |
key = 0
|
58 |
-
for path in
|
59 |
with open(path, encoding="utf-8") as f:
|
60 |
news = json.load(f)
|
61 |
for article in news:
|
|
|
45 |
)
|
46 |
|
47 |
def _split_generators(self, dl_manager):
|
48 |
+
downloaded_files = dl_manager.download(_URLS)
|
49 |
|
50 |
return [
|
51 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": downloaded_files})
|
52 |
]
|
53 |
|
54 |
+
def _generate_examples(self, filepaths):
|
55 |
"""This function returns the examples in the raw (text) form."""
|
56 |
+
logger.info("generating examples from = %s", filepaths)
|
57 |
key = 0
|
58 |
+
for path in filepaths:
|
59 |
with open(path, encoding="utf-8") as f:
|
60 |
news = json.load(f)
|
61 |
for article in news:
|