(item, template, prompt_mode)
| 14 | |
| 15 | |
| 16 | def _parse(item, template, prompt_mode): |
| 17 | prompt_format = [ |
| 18 | item['question'] + '\n' + '\n'.join([ |
| 19 | f'{chr(65+i)}) {option}' |
| 20 | for i, option in enumerate(item['options']) |
| 21 | ]) |
| 22 | ] |
| 23 | item['infer_prompt'] = template['prompt_format'][0].format(*prompt_format) |
| 24 | item['prompt_mode'] = prompt_mode |
| 25 | return item |
| 26 | |
| 27 | |
| 28 | @LOAD_DATASET.register_module() |