|
109 | 109 | }, |
110 | 110 | }, |
111 | 111 | } |
112 | | -template_handels = [] |
| 112 | +template_handles = [] |
113 | 113 |
|
114 | 114 | for template_type, template_type_groups in templates.items(): |
115 | 115 | for benchmark_name, template_groups in template_type_groups.items(): |
116 | 116 | for language, input_format in template_groups.items(): |
117 | 117 | template = MultipleChoiceTemplate( |
118 | 118 | input_format=input_format, |
119 | 119 | target_field="answer", |
120 | | - choices_seperator="\n", |
| 120 | + choices_separator="\n", |
121 | 121 | target_choice_format=" {choice_numeral}" |
122 | 122 | if "lm_eval_harness" in benchmark_name |
123 | 123 | else "{choice_numeral}", |
|
132 | 132 | overwrite=True, |
133 | 133 | ) |
134 | 134 |
|
135 | | - template_handels.append( |
| 135 | + template_handles.append( |
136 | 136 | { |
137 | 137 | "handle": template_handle, |
138 | 138 | "template_type": template_type, |
139 | 139 | "language": language, |
140 | 140 | } |
141 | 141 | ) |
142 | 142 |
|
143 | | -template_handels = pd.DataFrame(template_handels) |
144 | | -for template_type in template_handels.template_type.unique(): |
145 | | - for lang in template_handels.language.unique(): |
146 | | - template_handle_list = template_handels.query( |
| 143 | +template_handles = pd.DataFrame(template_handles) |
| 144 | +for template_type in template_handles.template_type.unique(): |
| 145 | + for lang in template_handles.language.unique(): |
| 146 | + template_handle_list = template_handles.query( |
147 | 147 | f'language=="{lang}" and template_type=="{template_type}"' |
148 | 148 | ).handle.tolist() |
149 | 149 |
|
|
167 | 167 | MultipleChoiceTemplate( |
168 | 168 | input_format=input_format, |
169 | 169 | target_field="answer", |
170 | | - choices_seperator="\n", |
| 170 | + choices_separator="\n", |
171 | 171 | postprocessors=["processors.first_character"], |
172 | 172 | ), |
173 | 173 | "templates.qa.multiple_choice.with_topic.mmlu", |
|
179 | 179 | MultipleChoiceTemplate( |
180 | 180 | input_format=input_format, |
181 | 181 | target_field="answer", |
182 | | - choices_seperator="\n", |
| 182 | + choices_separator="\n", |
183 | 183 | postprocessors=["processors.first_character"], |
184 | 184 | ), |
185 | 185 | "templates.qa.multiple_choice.with_context.with_topic.mmlu", |
|
193 | 193 | MultipleChoiceTemplate( |
194 | 194 | input_format=input_format, |
195 | 195 | target_field="answer", |
196 | | - choices_seperator="\n", |
| 196 | + choices_separator="\n", |
197 | 197 | postprocessors=["processors.first_character"], |
198 | 198 | ), |
199 | 199 | "templates.qa.multiple_choice.with_topic.helm", |
|
205 | 205 | MultipleChoiceTemplate( |
206 | 206 | input_format=input_format, |
207 | 207 | target_field="answer", |
208 | | - choices_seperator="\n", |
| 208 | + choices_separator="\n", |
209 | 209 | postprocessors=["processors.first_character"], |
210 | 210 | ), |
211 | 211 | "templates.qa.multiple_choice.with_context.with_topic.helm", |
|
219 | 219 | MultipleChoiceTemplate( |
220 | 220 | input_format=input_format, |
221 | 221 | target_field="answer", |
222 | | - choices_seperator="\n", |
| 222 | + choices_separator="\n", |
223 | 223 | postprocessors=["processors.first_character"], |
224 | 224 | ), |
225 | 225 | "templates.qa.multiple_choice.lm_eval_harness", |
|
232 | 232 | input_format="Question:\n{question}\nChoices:\n{choices}", |
233 | 233 | target_prefix="Answer:\n", |
234 | 234 | target_field="answer", |
235 | | - choices_seperator="\n", |
| 235 | + choices_separator="\n", |
236 | 236 | postprocessors=["processors.to_string_stripped", "processors.first_character"], |
237 | 237 | ), |
238 | 238 | "templates.qa.multiple_choice.title", |
|
245 | 245 | input_format="Question:\n{question}\nChoices:\n{choices}", |
246 | 246 | target_prefix="Answer:\n", |
247 | 247 | target_field="answer", |
248 | | - choices_seperator="\n", |
| 248 | + choices_separator="\n", |
249 | 249 | target_choice_format="{choice_numeral}. {choice_text}", |
250 | 250 | postprocessors=[ |
251 | 251 | "processors.take_first_non_empty_line", |
|
262 | 262 | MultipleChoiceTemplate( |
263 | 263 | input_format=input_format, |
264 | 264 | target_field="answer", |
265 | | - choices_seperator="\n", |
| 265 | + choices_separator="\n", |
266 | 266 | postprocessors=["processors.first_character"], |
267 | 267 | ), |
268 | 268 | "templates.qa.multiple_choice.with_context.lm_eval_harness", |
|
275 | 275 | input_format="{context_type}:\n{context}\nQuestion:\n{question}\nChoices:\n{choices}", |
276 | 276 | target_prefix="Answer:\n", |
277 | 277 | target_field="answer", |
278 | | - choices_seperator="\n", |
| 278 | + choices_separator="\n", |
279 | 279 | postprocessors=["processors.to_string_stripped", "processors.first_character"], |
280 | 280 | title_fields=["context_type"], |
281 | 281 | ), |
|
289 | 289 | input_format="{context_type}:\n{context}\nQuestion:\n{question}\nChoices:\n{choices}", |
290 | 290 | target_prefix="Answer:\n", |
291 | 291 | target_field="answer", |
292 | | - choices_seperator="\n", |
| 292 | + choices_separator="\n", |
293 | 293 | target_choice_format="{choice_numeral}. {choice_text}", |
294 | 294 | postprocessors=[ |
295 | 295 | "processors.take_first_non_empty_line", |
|
308 | 308 | MultipleChoiceTemplate( |
309 | 309 | input_format=input_format, |
310 | 310 | target_field="answer", |
311 | | - choices_seperator="\n", |
| 311 | + choices_separator="\n", |
312 | 312 | postprocessors=["processors.first_character"], |
313 | 313 | ), |
314 | 314 | "templates.qa.multiple_choice.with_topic.fm_eval", |
|
320 | 320 | MultipleChoiceTemplate( |
321 | 321 | input_format=input_format, |
322 | 322 | target_field="answer", |
323 | | - choices_seperator="\n", |
| 323 | + choices_separator="\n", |
324 | 324 | postprocessors=["processors.first_character"], |
325 | 325 | ), |
326 | 326 | "templates.qa.multiple_choice.with_context.with_topic.fm_eval", |
|
333 | 333 | input_format="{context_type}:\n{context}\nQuestion:\n{question}\nChoices:\n{choices}", |
334 | 334 | target_prefix="Answer:\n", |
335 | 335 | target_field="answer", |
336 | | - choices_seperator="\n", |
| 336 | + choices_separator="\n", |
337 | 337 | postprocessors=["processors.to_string_stripped", "processors.first_character"], |
338 | 338 | title_fields=["context_type"], |
339 | 339 | ), |
|
347 | 347 | input_format="{context_type}:\n{context}\nQuestion:\n{question}\nChoices:\n{choices}", |
348 | 348 | target_prefix="Answer:\n", |
349 | 349 | target_field="answer", |
350 | | - choices_seperator="\n", |
| 350 | + choices_separator="\n", |
351 | 351 | target_choice_format="{choice_numeral}. {choice_text}", |
352 | 352 | postprocessors=[ |
353 | 353 | "processors.take_first_non_empty_line", |
|
365 | 365 | input_format="Question:\n{question}\nChoices:\n{choices}", |
366 | 366 | target_prefix="Answer:\n", |
367 | 367 | target_field="answer", |
368 | | - choices_seperator="\n", |
| 368 | + choices_separator="\n", |
369 | 369 | postprocessors=["processors.to_string_stripped", "processors.first_character"], |
370 | 370 | ), |
371 | 371 | "templates.qa.multiple_choice.with_topic.title", |
|
378 | 378 | input_format="Question:\n{question}\nChoices:\n{choices}", |
379 | 379 | target_prefix="Answer:\n", |
380 | 380 | target_field="answer", |
381 | | - choices_seperator="\n", |
| 381 | + choices_separator="\n", |
382 | 382 | target_choice_format="{choice_numeral}. {choice_text}", |
383 | 383 | postprocessors=[ |
384 | 384 | "processors.take_first_non_empty_line", |
|
0 commit comments