MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / format_example

Function format_example

eval_general/eval_mmlu_hf.py:39–48  ·  view source on GitHub ↗
(line, include_answer=True)

Source from the content-addressed store, hash-verified

37 return model, tokenizer
38
39def format_example(line, include_answer=True):
40 example = 'Question: ' + line['question']
41 for choice in choices:
42 example += f'\n{choice}. {line[f"{choice}"]}'
43
44 if include_answer:
45 example += '\nAnswer: ' + line["answer"] + '\n\n'
46 else:
47 example += '\nAnswer:'
48 return example
49
50
51def generate_few_shot_prompt(k, subject, dev_df):

Callers 1

eval_subjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected