cwolff commited on
Commit
5290506
·
verified ·
1 Parent(s): a31b023

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. schemapile.py +4 -9
schemapile.py CHANGED
@@ -52,21 +52,16 @@ class Schemapile(datasets.GeneratorBasedBuilder):
52
  )
53
 
54
  def _split_generators(self, dl_manager):
55
- # Support both local and remote (Hub) loading
56
  data_files = getattr(self.config, "data_files", None)
57
-
58
- if data_files:
59
- data_path = dl_manager.download_and_extract(data_files)
60
- else:
61
- # Default to data.jsonl in repo
62
- data_path = dl_manager.download_and_extract("data.jsonl")
63
 
64
  return [
65
  datasets.SplitGenerator(
66
- name="all", # <-- not datasets.Split.TRAIN
67
  gen_kwargs={"filepath": data_path},
68
- ),
69
  ]
 
70
  def _generate_examples(self, filepath):
71
  with open(filepath, encoding="utf-8") as f:
72
  for idx, line in enumerate(f):
 
52
  )
53
 
54
  def _split_generators(self, dl_manager):
 
55
  data_files = getattr(self.config, "data_files", None)
56
+ data_path = dl_manager.download_and_extract(data_files or "data.jsonl")
 
 
 
 
 
57
 
58
  return [
59
  datasets.SplitGenerator(
60
+ name="full", # or any non-reserved name
61
  gen_kwargs={"filepath": data_path},
62
+ )
63
  ]
64
+
65
  def _generate_examples(self, filepath):
66
  with open(filepath, encoding="utf-8") as f:
67
  for idx, line in enumerate(f):