Muennighoff commited on
Commit
f453496
1 Parent(s): 465da57

Allow >= cols

Browse files
Files changed (1) hide show
  1. xstory_cloze.py +4 -1
xstory_cloze.py CHANGED
@@ -137,7 +137,8 @@ class XStoryCloze(datasets.GeneratorBasedBuilder):
137
  )
138
  _ = next(csv_reader)
139
  for id_, row in enumerate(csv_reader):
140
- if row and len(row) == 8:
 
141
  yield id_, {
142
  "story_id": row[0],
143
  "input_sentence_1": row[1],
@@ -148,4 +149,6 @@ class XStoryCloze(datasets.GeneratorBasedBuilder):
148
  "sentence_quiz2": row[6],
149
  "answer_right_ending": int(row[7]),
150
  }
 
 
151
 
 
137
  )
138
  _ = next(csv_reader)
139
  for id_, row in enumerate(csv_reader):
140
+ # The Spanish XStory Cloze has 10 columns with the last two being not needed
141
+ if row and len(row) >= 8:
142
  yield id_, {
143
  "story_id": row[0],
144
  "input_sentence_1": row[1],
 
149
  "sentence_quiz2": row[6],
150
  "answer_right_ending": int(row[7]),
151
  }
152
+ else:
153
+ raise ValueError(f"Unexpected row: {row}")
154