mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-24 17:05:03 +00:00
feat: Add Sized and Iterable base classes to ProceduralDataset
This commit is contained in:
parent
e4b032c814
commit
3a8a613573
1 changed files with 3 additions and 2 deletions
|
|
@ -1,10 +1,11 @@
|
|||
"""Base class for procedural dataset generators"""
|
||||
from abc import ABC, abstractmethod
|
||||
from collections.abc import Sized, Iterable
|
||||
from random import Random
|
||||
from typing import Optional
|
||||
from typing import Optional, Iterator, Dict, Any
|
||||
|
||||
|
||||
class ProceduralDataset(ABC):
|
||||
class ProceduralDataset(ABC, Sized, Iterable[Dict[str, Any]]):
|
||||
"""Abstract base class for procedural dataset generators"""
|
||||
|
||||
def __init__(self, seed: Optional[int] = None, size: int = 500):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue