MCPcopy Create free account
hub / github.com/SkyworkAI/Skywork / format_example

Function format_example

eval/evaluate_cmmlu.py:111–121  ·  view source on GitHub ↗
(line, subject, include_answer=True)

Source from the content-addressed store, hash-verified

109
110
111def format_example(line, subject, include_answer=True):
112 example = f"以下是关于{task2desc[subject]}的单项选择题,请直接给出正确答案的选项。\n\n"
113 example = example + "题目:" + line["Question"]
114 for choice in choices:
115 example += f'\n{choice}. {line[f"{choice}"]}'
116
117 if include_answer:
118 example += "\n答案:" + line["Answer"] + "\n\n"
119 else:
120 example += "\n答案:"
121 return example
122
123
124def generate_few_shot_prompt(k, subject, dev_df):

Callers 2

generate_few_shot_promptFunction · 0.70
eval_subjectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected