Akhil2507 commited on
Commit
6c14530
1 Parent(s): 0048292

Update loading_script.py

Browse files
Files changed (1) hide show
  1. loading_script.py +3 -5
loading_script.py CHANGED
@@ -131,14 +131,12 @@ class NewDataset(datasets.GeneratorBasedBuilder):
131
 
132
  with open(filepath, mode="r", newline="", encoding="utf-8") as f:
133
  csv_reader = csv.DictReader(f)
134
- for row in (csv_reader):
135
- yield {
136
  "Story": row["Story"],
137
  "Question": row["Question"],
138
  "span_start": row["span_start"],
139
  "span_end": row["span_end"],
140
  "span_text": row["span_text"],
141
  "Answer": row["Answer"]
142
- }
143
-
144
-
 
131
 
132
  with open(filepath, mode="r", newline="", encoding="utf-8") as f:
133
  csv_reader = csv.DictReader(f)
134
+ for key, row in enumerate(csv_reader):
135
+ yield key,{
136
  "Story": row["Story"],
137
  "Question": row["Question"],
138
  "span_start": row["span_start"],
139
  "span_end": row["span_end"],
140
  "span_text": row["span_text"],
141
  "Answer": row["Answer"]
142
+ }