mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
corrected failing airthmetic test
This commit is contained in:
parent
52869e3f89
commit
ba58ecf8ea
2 changed files with 6 additions and 5 deletions
|
|
@ -227,15 +227,16 @@ class BasicArithmeticDataset(ProceduralDataset):
|
||||||
answer_instruction = "Put your final answer after '=' without additional text."
|
answer_instruction = "Put your final answer after '=' without additional text."
|
||||||
|
|
||||||
if self.config.format_style == "simple":
|
if self.config.format_style == "simple":
|
||||||
return f"Calculate {expression} ="
|
return f"{answer_instruction} Calculate {expression} ="
|
||||||
else:
|
else:
|
||||||
templates = [
|
templates = [
|
||||||
"What is {0}? =",
|
"What is {0} =",
|
||||||
"Solve {0} and write answer after =",
|
"Solve {0}=",
|
||||||
"Compute {0} =",
|
"Compute {0} =",
|
||||||
"Evaluate: {0} ="
|
"Evaluate: {0} ="
|
||||||
]
|
]
|
||||||
return rng.choice(templates).format(expression) + f" {answer_instruction}"
|
template = rng.choice(templates).format(expression)
|
||||||
|
return f"{answer_instruction} {template}"
|
||||||
|
|
||||||
|
|
||||||
# Register the dataset
|
# Register the dataset
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ def test_arithmetic_dataset_format_styles():
|
||||||
|
|
||||||
config.format_style = "natural"
|
config.format_style = "natural"
|
||||||
dataset = BasicArithmeticDataset(config)
|
dataset = BasicArithmeticDataset(config)
|
||||||
assert all("=" not in item["question"] for item in dataset)
|
assert all("=" in item["question"] for item in dataset)
|
||||||
|
|
||||||
|
|
||||||
def test_arithmetic_dataset_iteration():
|
def test_arithmetic_dataset_iteration():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue