MCPcopy Create free account
hub / github.com/InternScience/SciReason / load

Method load

opencompass/datasets/piqa.py:82–112  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

80
81 @staticmethod
82 def load(path):
83 path = get_data_path(path)
84 if environ.get('DATASET_SOURCE') == 'ModelScope':
85 from modelscope import MsDataset
86 dataset = DatasetDict()
87 for split in ['train', 'validation']:
88 ms_dataset = MsDataset.load(path, split=split)
89 dataset_list = []
90 for item in ms_dataset:
91 label = item['label']
92 dataset_list.append({
93 'goal':
94 item['goal'],
95 'sol1':
96 item['sol1'],
97 'sol2':
98 item['sol2'],
99 'answer':
100 'NULL' if label < 0 else 'AB'[label]
101 })
102 dataset[split] = Dataset.from_list(dataset_list)
103 else:
104 train_dataset = PIQADatasetV2.load_single(path, 'train.jsonl',
105 'train-labels.lst')
106 val_dataset = PIQADatasetV2.load_single(path, 'dev.jsonl',
107 'dev-labels.lst')
108 dataset = DatasetDict({
109 'train': train_dataset,
110 'validation': val_dataset
111 })
112 return dataset
113
114
115@LOAD_DATASET.register_module()

Callers

nothing calls this directly

Calls 4

get_data_pathFunction · 0.90
getMethod · 0.80
loadMethod · 0.45
load_singleMethod · 0.45

Tested by

no test coverage detected