formatting

This commit is contained in:
Andreas Koepf 2025-02-16 16:18:39 +01:00
parent 20e0fb45bd
commit 44f8d7b6af
4 changed files with 7 additions and 20 deletions

View file

@ -225,16 +225,11 @@ class BasicArithmeticDataset(ProceduralDataset):
def _format_question(self, rng: Random, expression: str) -> str:
"""Format the expression with clear answer positioning"""
answer_instruction = "Put your final answer after '=' without additional text."
if self.config.format_style == "simple":
return f"{answer_instruction} Calculate {expression} ="
else:
templates = [
"What is {0} =",
"Solve {0}=",
"Compute {0} =",
"Evaluate: {0} ="
]
templates = ["What is {0} =", "Solve {0}=", "Compute {0} =", "Evaluate: {0} ="]
template = rng.choice(templates).format(expression)
return f"{answer_instruction} {template}"