in src/math_verify/tasks.py [0:0]
def gsm8k_prompt_function(x: dict, task_name: str) -> Doc:
if x.get("__few_shots"):
index = x["__index"]
few_shot_doc = (
GSM8K_FEW_SHOTS[index]
if index < len(GSM8K_FEW_SHOTS)
else GSM8K_FEW_SHOTS[-1]
)
answer = few_shot_doc["answer"]
question = few_shot_doc["question"]
else:
answer = f"{x['answer'].split('####')[-1].strip()}"
question = x["question"]
query = dedent(
f"""\
Question: {question}
Step-by-Step Answer:\
"""
).strip()
choices = [f" {answer}"]
return Doc(query=query, choices=choices, gold_index=0)