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
|
|
@ -5,6 +5,8 @@ from typing import Any, Optional
|
|||
from ..coaching import BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
DATASET_NAME = "bitwise_arithmetic"
|
||||
|
||||
|
||||
@dataclass
|
||||
class BitwiseArithmeticConfig:
|
||||
|
|
@ -155,7 +157,12 @@ class BitwiseArithmeticDataset(ProceduralDataset):
|
|||
return {
|
||||
"question": problem_str,
|
||||
"answer": answer,
|
||||
"metadata": {"problem": problem, "difficulty": {"difficulty": self.config.difficulty}},
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"problem": problem,
|
||||
"difficulty": {"difficulty": self.config.difficulty},
|
||||
},
|
||||
}
|
||||
|
||||
def score_answer(self, answer: Optional[str], entry: dict[str, Any]) -> float:
|
||||
|
|
@ -193,4 +200,4 @@ class BitwiseArithmeticCurriculum(BaseCurriculum):
|
|||
|
||||
|
||||
# Register the dataset with the factory.
|
||||
register_dataset("bitwise_arithmetic", BitwiseArithmeticDataset, BitwiseArithmeticConfig, BitwiseArithmeticCurriculum)
|
||||
register_dataset(DATASET_NAME, BitwiseArithmeticDataset, BitwiseArithmeticConfig, BitwiseArithmeticCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue