mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
pass config to ProceduralDataset base
This commit is contained in:
parent
df2b8d2809
commit
e9549f2a63
20 changed files with 45 additions and 80 deletions
|
|
@ -20,7 +20,7 @@ class FractionSimplificationConfig:
|
|||
seed: Optional[int] = None
|
||||
size: int = 500 # Virtual dataset size
|
||||
|
||||
def validate(self):
|
||||
def validate(self) -> None:
|
||||
"""Validate configuration parameters"""
|
||||
assert self.min_value > 0, "min_value must be positive"
|
||||
assert self.max_value > self.min_value, "max_value must be > min_value"
|
||||
|
|
@ -37,9 +37,7 @@ class FractionSimplificationDataset(ProceduralDataset):
|
|||
"""Generates fraction simplification tasks"""
|
||||
|
||||
def __init__(self, config: FractionSimplificationConfig):
|
||||
self.config = config
|
||||
self.config.validate()
|
||||
super().__init__(seed=config.seed, size=config.size)
|
||||
super().__init__(config=config, seed=config.seed, size=config.size)
|
||||
|
||||
def _generate_fraction(self, rng: Random) -> Tuple[int, int, int, int]:
|
||||
"""Generate a random fraction and its simplified form.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue