mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-25 17:10:51 +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
|
|
@ -60,6 +60,8 @@ QUESTION_TEMPLATE = """Your task is to count how many legs there are in total wh
|
|||
Now, how many legs are there in total if you have {animals}?
|
||||
"""
|
||||
|
||||
DATASET_NAME = "leg_counting"
|
||||
|
||||
|
||||
@dataclass
|
||||
class LegCountingConfig:
|
||||
|
|
@ -118,6 +120,8 @@ class LegCountingDataset(ProceduralDataset):
|
|||
"question": QUESTION_TEMPLATE.format(animals=", ".join(animal_list)),
|
||||
"answer": str(total_legs),
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"animals": animals,
|
||||
"num_animals": len(animals),
|
||||
"total_legs": total_legs,
|
||||
|
|
@ -152,4 +156,4 @@ class LegCountingCurriculum(BaseCurriculum):
|
|||
)
|
||||
|
||||
|
||||
register_dataset("leg_counting", LegCountingDataset, LegCountingConfig, LegCountingCurriculum)
|
||||
register_dataset(DATASET_NAME, LegCountingDataset, LegCountingConfig, LegCountingCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue