khalidalt commited on
Commit
b961258
1 Parent(s): b167430

Update xtd_11.py

Browse files
Files changed (1) hide show
  1. xtd_11.py +6 -9
xtd_11.py CHANGED
@@ -51,24 +51,21 @@ class XTD_11(datasets.GeneratorBasedBuilder):
51
 
52
  # Generate splits for each language
53
  splits = []
54
- for lang in self.config.subset:
55
- splits.append(SplitGenerator(
56
- name=datasets.Split.TEST,
57
- # Assuming the use of URLs. For local files, adjust accordingly.
58
- gen_kwargs={"filepaths": f"{_Base_url}{lang}.json"}
59
- ))
60
 
61
 
62
  return splits
63
 
64
- def _generate_examples(self, filepath=None, filepaths=None):
65
  """Yields examples."""
66
  # This method needs to handle both single and multiple filepaths
67
  # Adjust the logic based on how you want to load and yield data from your JSON files
68
 
69
  id_ = 0
70
- print(filepaths)
71
- print(filepath)
72
  for filepath in filepaths:
73
  # Load data from a single file
74
  with open(filepath, encoding="utf-8") as f:
 
51
 
52
  # Generate splits for each language
53
  splits = []
54
+ splits.appendSplitGenerator(
55
+ name=datasets.Split.TEST,
56
+ # Assuming the use of URLs. For local files, adjust accordingly.
57
+ gen_kwargs={"filepaths": [f"{_Base_url}{lang}.json" for lang in self.config.subset]}
58
+ ))
 
59
 
60
 
61
  return splits
62
 
63
+ def _generate_examples(self, filepaths=None):
64
  """Yields examples."""
65
  # This method needs to handle both single and multiple filepaths
66
  # Adjust the logic based on how you want to load and yield data from your JSON files
67
 
68
  id_ = 0
 
 
69
  for filepath in filepaths:
70
  # Load data from a single file
71
  with open(filepath, encoding="utf-8") as f: