add ProductsDataset (multiplication tasks)

This commit is contained in:
Andreas Koepf 2025-02-13 17:59:02 +01:00
parent 17485fad67
commit 1996ffa6d8
10 changed files with 56 additions and 56 deletions

View file

@ -122,9 +122,9 @@ class CalendarArithmeticDataset(ProceduralDataset):
self.tasks = [self.task_handlers[task] for task in self.config.tasks]
def __getitem__(self, idx: int) -> dict:
item_rng = random.Random(self.seed + idx)
task = item_rng.choice(self.tasks)
question, answer, metadata = task(item_rng)
rng = random.Random(self.seed + idx)
task = rng.choice(self.tasks)
question, answer, metadata = task(rng)
return {
"question": question,
"answer": str(answer),