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
c6d01541aa
commit
4c47527130
104 changed files with 549 additions and 146 deletions
|
|
@ -7,6 +7,8 @@ from typing import Any, Optional
|
|||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
DATASET_NAME = "decimal_arithmetic"
|
||||
|
||||
|
||||
@dataclass
|
||||
class DecimalArithmeticConfig:
|
||||
|
|
@ -189,6 +191,8 @@ class DecimalArithmeticDataset(ProceduralDataset):
|
|||
"question": problem_str,
|
||||
"answer": str(answer),
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"decimal_places": decimal_places,
|
||||
"num_terms": terms,
|
||||
"difficulty": {
|
||||
|
|
@ -249,4 +253,4 @@ class DecimalArithmeticCurriculum(BaseCurriculum):
|
|||
|
||||
|
||||
# Register the dataset with the factory.
|
||||
register_dataset("decimal_arithmetic", DecimalArithmeticDataset, DecimalArithmeticConfig, DecimalArithmeticCurriculum)
|
||||
register_dataset(DATASET_NAME, DecimalArithmeticDataset, DecimalArithmeticConfig, DecimalArithmeticCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue