MCPcopy Create free account
hub / github.com/amazon-science/mm-cot / load_data_std

Function load_data_std

utils_data.py:16–32  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

14}
15
16def load_data_std(args):
17 problems = json.load(open(os.path.join(args.data_root, 'scienceqa/problems.json')))
18 pid_splits = json.load(open(os.path.join(args.data_root, 'scienceqa/pid_splits.json')))
19 captions = json.load(open(args.caption_file))["captions"]
20
21 for qid in problems:
22 problems[qid]['caption'] = captions[qid] if qid in captions else ""
23
24 train_qids = pid_splits['%s' % (args.train_split)]
25 val_qids = pid_splits['%s' % (args.val_split)]
26 test_qids = pid_splits['%s' % (args.test_split)]
27 print(f"number of train problems: {len(train_qids)}\n")
28 print(f"number of val problems: {len(val_qids)}\n")
29 print(f"number of test problems: {len(test_qids)}\n")
30
31 qids = {'train': train_qids, 'val':val_qids,'test':test_qids}
32 return problems, qids,
33
34def load_data_img(args):
35 problems = json.load(open(os.path.join(args.data_root, 'scienceqa/problems.json')))

Callers 1

main.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected