Add puzzles
This commit is contained in:
parent
b2d7ba2f1d
commit
9ca4ed5a6a
@ -24,4 +24,15 @@ After `pip install`ing the open-r1 repo, you can very quickly get started
|
||||
>>> config.min_coefficient = -1000
|
||||
>>> config.max_coefficient = 1000
|
||||
>>> harder_task = LinearEquationTask(config)
|
||||
```
|
||||
```
|
||||
|
||||
## Adding new puzzles
|
||||
|
||||
[add puzzle guide goes here]
|
||||
|
||||
## Coming soon:
|
||||
|
||||
- Proper indexing of puzzles
|
||||
- More puzzle types!
|
||||
- Lazy loading (if the module gets very big)
|
||||
- Gu
|
@ -44,6 +44,6 @@ class BaseTask(ABC):
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def validate(self, output, answer) -> float:
|
||||
def verify(self, output, answer) -> float:
|
||||
# This should return a score between 0. and 1. based on how well the output matches the answer
|
||||
raise NotImplementedError
|
@ -10,6 +10,7 @@ class LinearEquationConfig(BaseConfig):
|
||||
min_var_value = -10
|
||||
max_var_value = 10
|
||||
|
||||
|
||||
class LinearEquationTask(BaseTask):
|
||||
config_class = LinearEquationConfig
|
||||
|
||||
@ -37,7 +38,7 @@ class LinearEquationTask(BaseTask):
|
||||
|
||||
return equation, var_value
|
||||
|
||||
def validate(self, output, answer):
|
||||
def verify(self, output, answer):
|
||||
# If there's only one number in the output, it's the answer
|
||||
numbers = re.findall(r"\d+", output)
|
||||
if len(numbers) == 1:
|
||||
|
Loading…
x
Reference in New Issue
Block a user