Datasets:
debug iii
Browse files- ssl4eo_eu_forest.py +9 -10
ssl4eo_eu_forest.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
|
| 2 |
import json
|
| 3 |
import datasets
|
|
|
|
| 4 |
|
| 5 |
class SSL4EOEUForest(datasets.GeneratorBasedBuilder):
|
| 6 |
"""
|
|
@@ -58,22 +59,20 @@ note = {This work was carried under the EvoLand project, cf. https://www.evo-lan
|
|
| 58 |
)
|
| 59 |
|
| 60 |
def _split_generators(self, dl_manager):
|
| 61 |
-
|
| 62 |
return [
|
| 63 |
datasets.SplitGenerator(
|
| 64 |
name=datasets.Split.TRAIN,
|
| 65 |
-
gen_kwargs={"
|
| 66 |
)
|
| 67 |
]
|
| 68 |
|
| 69 |
-
def _generate_examples(self,
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
data = json.loads(line)
|
| 76 |
-
yield idx, data
|
| 77 |
|
| 78 |
|
| 79 |
def features_to_croissant(features):
|
|
|
|
| 1 |
|
| 2 |
import json
|
| 3 |
import datasets
|
| 4 |
+
from datasets.utils.file_utils import xopen
|
| 5 |
|
| 6 |
class SSL4EOEUForest(datasets.GeneratorBasedBuilder):
|
| 7 |
"""
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager):
|
| 62 |
+
# Pass the file path directly — not as a list
|
| 63 |
return [
|
| 64 |
datasets.SplitGenerator(
|
| 65 |
name=datasets.Split.TRAIN,
|
| 66 |
+
gen_kwargs={"filepath": "meta.jsonl"},
|
| 67 |
)
|
| 68 |
]
|
| 69 |
|
| 70 |
+
def _generate_examples(self, filepath):
|
| 71 |
+
print("Resolved path:", filepath)
|
| 72 |
+
with xopen(filepath, encoding="utf-8") as f:
|
| 73 |
+
for idx, line in enumerate(f):
|
| 74 |
+
data = json.loads(line)
|
| 75 |
+
yield idx, data
|
|
|
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
def features_to_croissant(features):
|