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
|
|
@ -26,6 +26,8 @@ Group the following list of words into anagrams:
|
|||
{words}
|
||||
"""
|
||||
|
||||
DATASET_NAME = "group_anagrams"
|
||||
|
||||
|
||||
@dataclass
|
||||
class GroupAnagramsConfig:
|
||||
|
|
@ -115,6 +117,8 @@ class GroupAnagramsDataset(ProceduralDataset):
|
|||
"question": QUESTION_TEMPLATE.format(words=json.dumps(words)),
|
||||
"answer": answer_str,
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"words": words,
|
||||
"solution": answer,
|
||||
"anagram_groups": anagram_groups,
|
||||
|
|
@ -149,4 +153,4 @@ class GroupAnagramsCurriculum(BaseCurriculum):
|
|||
)
|
||||
|
||||
|
||||
register_dataset("group_anagrams", GroupAnagramsDataset, GroupAnagramsConfig, GroupAnagramsCurriculum)
|
||||
register_dataset(DATASET_NAME, GroupAnagramsDataset, GroupAnagramsConfig, GroupAnagramsCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue