mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
reformatted prompt
This commit is contained in:
parent
c28688cb96
commit
a59e4cc918
1 changed files with 11 additions and 6 deletions
|
|
@ -223,14 +223,19 @@ class BasicArithmeticDataset(ProceduralDataset):
|
|||
return expression, result
|
||||
|
||||
def _format_question(self, rng: Random, expression: str) -> str:
|
||||
"""Format the expression according to config style"""
|
||||
base_question = "Return only the answer to the following question: {question} ="
|
||||
"""Format the expression with clear answer positioning"""
|
||||
answer_instruction = "Put your final answer after '=' without additional text."
|
||||
|
||||
if self.config.format_style == "simple":
|
||||
return base_question.format(question=expression)
|
||||
return f"Calculate {expression} ="
|
||||
else:
|
||||
templates = ["What is {0}?", "Calculate {0}", "Solve {0}", "Evaluate the expression: {0}"]
|
||||
question = rng.choice(templates).format(expression)
|
||||
return base_question.format(question=question)
|
||||
templates = [
|
||||
"What is {0}? =",
|
||||
"Solve {0} and write answer after =",
|
||||
"Compute {0} =",
|
||||
"Evaluate: {0} ="
|
||||
]
|
||||
return rng.choice(templates).format(expression) + f" {answer_instruction}"
|
||||
|
||||
|
||||
# Register the dataset
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue