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

Function format_example

light-eval/src/eval_ceval.py:86–94  ·  view source on GitHub ↗
(line, include_answer=True)

Source from the content-addressed store, hash-verified

84 return model
85
86def format_example(line, include_answer=True):
87 example = line['question']
88 for choice in choices:
89 example += f'\n{choice}. {line[f"{choice}"]}'
90 if include_answer:
91 example += '\n答案:' + line["answer"] + '\n\n'
92 else:
93 example += '\n答案:'
94 return example
95
96def generate_few_shot_prompt(subject, dev_df, ntrain=-1):
97 prompt = f"以下是中国关于{subject}考试的单项选择题,请选出其中的正确答案。\n\n"

Callers 2

generate_few_shot_promptFunction · 0.70
run_infer_evalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected