mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-28 17:29:39 +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
|
|
@ -14,6 +14,9 @@ Provide your answer as a comma-separated sequence of uppercase letters without s
|
|||
Each step must be a valid English word."""
|
||||
|
||||
|
||||
DATASET_NAME = "word_ladder"
|
||||
|
||||
|
||||
@dataclass
|
||||
class WordLadderConfig:
|
||||
"""Configuration for word ladder task generation"""
|
||||
|
|
@ -219,6 +222,8 @@ class WordLadderDataset(ProceduralDataset):
|
|||
"question": QUESTION_TEMPLATE.format(start=start, end=end),
|
||||
"answer": ",".join(path),
|
||||
"metadata": {
|
||||
"source_dataset": DATASET_NAME,
|
||||
"source_index": idx,
|
||||
"start_word": start,
|
||||
"end_word": end,
|
||||
"word_length": length,
|
||||
|
|
@ -285,4 +290,4 @@ class WordLadderCurriculum(BaseCurriculum):
|
|||
)
|
||||
|
||||
|
||||
register_dataset("word_ladder", WordLadderDataset, WordLadderConfig, WordLadderCurriculum)
|
||||
register_dataset(DATASET_NAME, WordLadderDataset, WordLadderConfig, WordLadderCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue