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

Method load_single

opencompass/datasets/rolebench.py:16–25  ·  view source on GitHub ↗
(source_file, desc_list)

Source from the content-addressed store, hash-verified

14
15 @staticmethod
16 def load_single(source_file, desc_list):
17 with open(source_file, 'r', encoding='utf-8') as f:
18 source_data = [json.loads(line) for line in f.readlines()]
19 dataset = [{
20 'role': item['role'],
21 'desc': desc_list[item['role']],
22 'question': item['question'],
23 'answer': item['generated'][0]
24 } for item in source_data]
25 return dataset
26
27 @staticmethod
28 def load_desc(path):

Callers 1

load_datasetMethod · 0.45

Calls 2

openFunction · 0.85
readlinesMethod · 0.45

Tested by

no test coverage detected