JeremyAlain commited on
Commit
f0cd1eb
1 Parent(s): 02d81b5

loading script created

Browse files
Files changed (1) hide show
  1. 123_test.py +15 -16
123_test.py CHANGED
@@ -131,19 +131,18 @@ class FewshotPretraining(datasets.GeneratorBasedBuilder):
131
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
132
  print("generating {}".format(file_paths))
133
  for file_path in file_paths:
134
- with open(file_path, encoding="utf-8") as f:
135
- data = pd.read_json(file_path, orient="records", lines=True)
136
- for i in range(data.shape[0]):
137
- row = data.iloc[i]
138
- # Yields examples as (key, example) tuples
139
- key = row["task"] + "_i"
140
- yield key, {
141
- "task": data["task"],
142
- "input": data["input"],
143
- "output": data["output"],
144
- "options": data["options"],
145
- "pageTitle": data["pageTitle"],
146
- "outputColName": data["outputColName"],
147
- "url": data["url"],
148
- "wdcFile": data["wdcFile"],
149
- }
 
131
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
132
  print("generating {}".format(file_paths))
133
  for file_path in file_paths:
134
+ data = pd.read_json(file_path, orient="records", lines=True)
135
+ for i in range(data.shape[0]):
136
+ row = data.iloc[i]
137
+ # Yields examples as (key, example) tuples
138
+ key = row["task"] + "_i"
139
+ yield key, {
140
+ "task": data["task"],
141
+ "input": data["input"],
142
+ "output": data["output"],
143
+ "options": data["options"],
144
+ "pageTitle": data["pageTitle"],
145
+ "outputColName": data["outputColName"],
146
+ "url": data["url"],
147
+ "wdcFile": data["wdcFile"],
148
+ }