mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-30 17:40:45 +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
c6d01541aa
commit
4c47527130
104 changed files with 549 additions and 146 deletions
|
|
@ -6,6 +6,8 @@ from typing import Any, Optional
|
|||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
DATASET_NAME = "decimal_chain_sum"
|
||||
|
||||
|
||||
@dataclass
|
||||
class DecimalChainSumConfig:
|
||||
|
|
@ -66,6 +68,8 @@ class DecimalChainSumDataset(ProceduralDataset):
|
|||
"question": f"State the final answer to the following arithmetic problem: {expression} =",
|
||||
"answer": str(result),
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"num_terms": num_terms,
|
||||
"num_digits": num_digits,
|
||||
"expression": expression,
|
||||
|
|
@ -195,4 +199,4 @@ class DecimalChainSumCurriculum(BaseCurriculum):
|
|||
)
|
||||
|
||||
|
||||
register_dataset("decimal_chain_sum", DecimalChainSumDataset, DecimalChainSumConfig, DecimalChainSumCurriculum)
|
||||
register_dataset(DATASET_NAME, DecimalChainSumDataset, DecimalChainSumConfig, DecimalChainSumCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue