corrected failing airthmetic test

This commit is contained in:
joesharratt1229 2025-02-16 12:01:54 +00:00
parent 52869e3f89
commit ba58ecf8ea
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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():