Datasets:
debugging ii
Browse files- ssl4eo_eu_forest.py +4 -5
ssl4eo_eu_forest.py
CHANGED
|
@@ -58,19 +58,18 @@ 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={"files":
|
| 66 |
)
|
| 67 |
]
|
| 68 |
|
| 69 |
def _generate_examples(self, files):
|
| 70 |
for file_url in files:
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
# In streaming mode open(file_url) is supported by datasets' patched I/O
|
| 74 |
with datasets.utils.file_utils.xopen(file_url, encoding="utf-8") as f:
|
| 75 |
for idx, line in enumerate(f):
|
| 76 |
data = json.loads(line)
|
|
|
|
| 58 |
)
|
| 59 |
|
| 60 |
def _split_generators(self, dl_manager):
|
| 61 |
+
files_iter = dl_manager.iter_files(["meta.jsonl"])
|
| 62 |
return [
|
| 63 |
datasets.SplitGenerator(
|
| 64 |
name=datasets.Split.TRAIN,
|
| 65 |
+
gen_kwargs={"files": files_iter},
|
| 66 |
)
|
| 67 |
]
|
| 68 |
|
| 69 |
def _generate_examples(self, files):
|
| 70 |
for file_url in files:
|
| 71 |
+
print("Resolved path:", file_url) # verify what is being opened
|
| 72 |
+
# Use xopen which supports HF Hub URLs, fsspec, streaming, and auth
|
|
|
|
| 73 |
with datasets.utils.file_utils.xopen(file_url, encoding="utf-8") as f:
|
| 74 |
for idx, line in enumerate(f):
|
| 75 |
data = json.loads(line)
|