mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-23 16:55:05 +00:00
fix(envs): Add source dataset and index to metadata (#388)
* add source dataset and index to metadata * fix typo * fix coach class and its test
This commit is contained in:
parent
7475a20700
commit
ce0a6c4878
104 changed files with 549 additions and 146 deletions
|
|
@ -6,6 +6,8 @@ from typing import Any, Optional
|
|||
from ..coaching import BaseCurriculum, RangeAttributeDefinition, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
DATASET_NAME = "modulo_grid"
|
||||
|
||||
|
||||
@dataclass
|
||||
class ModuloGridConfig:
|
||||
|
|
@ -136,6 +138,8 @@ class ModuloGridDataset(ProceduralDataset):
|
|||
"question": question,
|
||||
"answer": flatten_grid(grid),
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"divisor": divisor,
|
||||
"target": target,
|
||||
"operation": operation,
|
||||
|
|
@ -190,4 +194,4 @@ class ModuloGridCurriculum(BaseCurriculum):
|
|||
|
||||
|
||||
# Register the dataset
|
||||
register_dataset("modulo_grid", ModuloGridDataset, ModuloGridConfig, ModuloGridCurriculum)
|
||||
register_dataset(DATASET_NAME, ModuloGridDataset, ModuloGridConfig, ModuloGridCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue