Datasets:

Modalities:
Geospatial
Languages:
English
DOI:
Libraries:
License:
cmalbrec commited on
Commit
a090c7a
·
verified ·
1 Parent(s): f8b9396

debugging v

Browse files
Files changed (1) hide show
  1. 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
- # 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):
 
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):