Datasets:

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

debug iii

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