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
|
|
@ -18,7 +18,7 @@ class BaseConversionConfig:
|
|||
seed: Optional[int] = None
|
||||
size: int = 500 # Virtual dataset size
|
||||
|
||||
def validate(self):
|
||||
def validate(self) -> None:
|
||||
"""Validate configuration parameters"""
|
||||
assert 2 <= self.min_base <= 36, "min_base must be between 2 and 36"
|
||||
assert self.min_base <= self.max_base <= 36, "max_base must be between min_base and 36"
|
||||
|
|
@ -30,9 +30,7 @@ class BaseConversionDataset(ProceduralDataset):
|
|||
"""Generates base conversion tasks"""
|
||||
|
||||
def __init__(self, config: BaseConversionConfig):
|
||||
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 _format_base_name(self, base: int) -> str:
|
||||
"""Get human-readable name for common bases"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue