MCPcopy
hub / github.com/Tele-AI/Telechat / get_input_data

Function get_input_data

evaluation/score_MMLU.py:22–31  ·  view source on GitHub ↗
(test_file_path,filename)

Source from the content-addressed store, hash-verified

20
21# get result
22def get_input_data(test_file_path,filename):
23 _hint = f'There is a single choice question about {filename.replace("_test.csv", " ")}. Answer the question by replying A, B, C or D.'
24 df = pd.read_csv(os.path.join(test_file_path,filename),header=None,names=["input","A","B","C","D","answer"])
25 data = []
26 for i in range(len(df)):
27 line = df.iloc[i]
28 input = f"{_hint}\nQuestion: {line['input']}\nA. {line['A']}\nB. {line['B']}\nC. {line['C']}\nD. {line['D']}\nAnswer: "
29 target = line["answer"]
30 data.append({"input":input,"target":target})
31 return data
32# post process
33def get_capital_answer(text):
34 patterns = [

Callers 1

score_MMLU.pyFile · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected