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

Method load

opencompass/datasets/mgsm.py:16–29  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

14
15 @staticmethod
16 def load(path: str):
17 path = get_data_path(path, local_mode=True)
18 src_lines = open(path, 'r', encoding='utf-8').readlines()
19 data = {'question': [], 'answer': []}
20 for lines in src_lines:
21 question, answer = lines.strip().split('\t')
22 data['question'].append(question)
23 data['answer'].append(answer)
24
25 dataset = Dataset.from_dict({
26 'question': data['question'],
27 'answer': data['answer']
28 })
29 return dataset
30
31
32LANG_TO_ANSWER_PREFIX = {

Callers

nothing calls this directly

Calls 3

get_data_pathFunction · 0.90
openFunction · 0.85
readlinesMethod · 0.45

Tested by

no test coverage detected