Datasets:
debugging v
Browse files- ssl4eo_eu_forest.py +10 -8
ssl4eo_eu_forest.py
CHANGED
|
@@ -59,20 +59,22 @@ note = {This work was carried under the EvoLand project, cf. https://www.evo-lan
|
|
| 59 |
)
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager):
|
| 62 |
-
|
| 63 |
return [
|
| 64 |
datasets.SplitGenerator(
|
| 65 |
name=datasets.Split.TRAIN,
|
| 66 |
-
gen_kwargs={"
|
| 67 |
)
|
| 68 |
]
|
| 69 |
|
| 70 |
-
def _generate_examples(self,
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
def features_to_croissant(features):
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager):
|
| 62 |
+
files = dl_manager.iter_files("")
|
| 63 |
return [
|
| 64 |
datasets.SplitGenerator(
|
| 65 |
name=datasets.Split.TRAIN,
|
| 66 |
+
gen_kwargs={"files": files},
|
| 67 |
)
|
| 68 |
]
|
| 69 |
|
| 70 |
+
def _generate_examples(self, files):
|
| 71 |
+
for file_url in files:
|
| 72 |
+
if file_url.endswith("meta.jsonl"):
|
| 73 |
+
print("Streaming from:", file_url)
|
| 74 |
+
with xopen(file_url, encoding="utf-8") as f:
|
| 75 |
+
for idx, line in enumerate(f):
|
| 76 |
+
data = json.loads(line)
|
| 77 |
+
yield idx, data
|
| 78 |
|
| 79 |
|
| 80 |
def features_to_croissant(features):
|