mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-27 17:23:19 +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
|
|
@ -11,6 +11,9 @@ class ProceduralDataset(ABC, Sized, Iterable[Dict[str, Any]]):
|
|||
|
||||
def __init__(self, config: Any, seed: Optional[int] = None, size: int = 500):
|
||||
"""Initialize the dataset with config, optional seed and size"""
|
||||
if hasattr(config, "validate") and callable(config.validate):
|
||||
config.validate()
|
||||
|
||||
self.config = config
|
||||
self.size = size
|
||||
self.seed = seed if seed is not None else Random().randint(0, 2**32)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue