MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / format_example

Function format_example

light-eval/src/eval_cmmlu.py:92–101  ·  view source on GitHub ↗
(line, include_answer=True)

Source from the content-addressed store, hash-verified

90 return model
91
92def format_example(line, include_answer=True):
93 example = "问题:" + line["Question"]
94 for choice in choices:
95 example += f'\n{choice}. {line[f"{choice}"]}'
96
97 if include_answer:
98 example += "\n答案:" + line["Answer"] + "\n\n"
99 else:
100 example += "\n答案:"
101 return example
102
103def generate_few_shot_prompt(task, dev_df, ntrain=-1):
104 prompt = "以下是关于{}的单项选择题,请直接给出正确答案的选项。\n\n".format(name_en2zh[task])

Callers 2

generate_few_shot_promptFunction · 0.70
run_infer_evalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected