mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +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
|
|
@ -25,6 +25,9 @@ Given the following string, provide the answer after inserting the characters ac
|
|||
"""
|
||||
|
||||
|
||||
DATASET_NAME = "string_insertion"
|
||||
|
||||
|
||||
@dataclass
|
||||
class StringInsertionConfig:
|
||||
"""Configuration for String Insertion dataset generation"""
|
||||
|
|
@ -102,6 +105,8 @@ class StringInsertionDataset(ProceduralDataset):
|
|||
"question": QUESTION_TEMPLATE.format(string=string),
|
||||
"answer": str(answer),
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"string": string,
|
||||
"solution": answer,
|
||||
"string_length": string_length,
|
||||
|
|
@ -129,4 +134,4 @@ class StringInsertionCurriculum(BaseCurriculum):
|
|||
)
|
||||
|
||||
|
||||
register_dataset("string_insertion", StringInsertionDataset, StringInsertionConfig, StringInsertionCurriculum)
|
||||
register_dataset(DATASET_NAME, StringInsertionDataset, StringInsertionConfig, StringInsertionCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue