Datasets:
bug fix vii
Browse files- ssl4eo_eu_forest.py +5 -6
ssl4eo_eu_forest.py
CHANGED
|
@@ -57,15 +57,15 @@ note = {This work was carried under the EvoLand project, cf. https://www.evo-lan
|
|
| 57 |
license="CC-BY-4.0",
|
| 58 |
)
|
| 59 |
|
|
|
|
| 60 |
def _split_generators(self, dl_manager):
|
| 61 |
"""
|
| 62 |
Define dataset splits - single "training" split for now.
|
| 63 |
"""
|
| 64 |
-
# Streaming mode doesn't download files
|
| 65 |
return [
|
| 66 |
datasets.SplitGenerator(
|
| 67 |
name=datasets.Split.TRAIN,
|
| 68 |
-
gen_kwargs={"filepath":
|
| 69 |
)
|
| 70 |
]
|
| 71 |
|
|
@@ -73,10 +73,9 @@ note = {This work was carried under the EvoLand project, cf. https://www.evo-lan
|
|
| 73 |
"""
|
| 74 |
Streaming-compliant serving of metadata for SSL4EO data samples.
|
| 75 |
"""
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
yield idx, json.loads(line)
|
| 80 |
|
| 81 |
|
| 82 |
|
|
|
|
| 57 |
license="CC-BY-4.0",
|
| 58 |
)
|
| 59 |
|
| 60 |
+
|
| 61 |
def _split_generators(self, dl_manager):
|
| 62 |
"""
|
| 63 |
Define dataset splits - single "training" split for now.
|
| 64 |
"""
|
|
|
|
| 65 |
return [
|
| 66 |
datasets.SplitGenerator(
|
| 67 |
name=datasets.Split.TRAIN,
|
| 68 |
+
gen_kwargs={"filepath": "meta.jsonl"},
|
| 69 |
)
|
| 70 |
]
|
| 71 |
|
|
|
|
| 73 |
"""
|
| 74 |
Streaming-compliant serving of metadata for SSL4EO data samples.
|
| 75 |
"""
|
| 76 |
+
with open(filepath, encoding="utf-8") as f:
|
| 77 |
+
for idx, line in enumerate(f):
|
| 78 |
+
yield idx, json.loads(line)
|
|
|
|
| 79 |
|
| 80 |
|
| 81 |
|