(example, idx)
| 49 | def make_map_fn(split): |
| 50 | |
| 51 | def process_fn(example, idx): |
| 52 | problem = example.pop('problem') |
| 53 | prompt = instruction_following[args.mode] |
| 54 | # answer = example.pop('answer') |
| 55 | images = example.pop('images') |
| 56 | |
| 57 | if args.mode == 'visual': |
| 58 | data = { |
| 59 | "data_source": args.mode, |
| 60 | "prompt": [{ |
| 61 | "role": "user", |
| 62 | "content": prompt, |
| 63 | }], |
| 64 | "images": images, |
| 65 | "ability": "agent", |
| 66 | "extra_info": { |
| 67 | 'split': split, |
| 68 | 'index': idx, |
| 69 | } |
| 70 | } |
| 71 | else: |
| 72 | data = { |
| 73 | "data_source": args.mode, |
| 74 | "prompt": [{ |
| 75 | "role": "user", |
| 76 | "content": prompt, |
| 77 | }], |
| 78 | "ability": "agent", |
| 79 | "extra_info": { |
| 80 | 'split': split, |
| 81 | 'index': idx, |
| 82 | } |
| 83 | } |
| 84 | return data |
| 85 | |
| 86 | return process_fn |
| 87 |
nothing calls this directly
no outgoing calls
no test coverage detected