mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-22 16:49:06 +00:00
lazy import of wordle_words
This commit is contained in:
parent
ee2c03ea65
commit
92ffda4b8b
1 changed files with 4 additions and 2 deletions
|
|
@ -4,7 +4,6 @@ from typing import Dict, Optional
|
||||||
|
|
||||||
import pyfiglet
|
import pyfiglet
|
||||||
|
|
||||||
from ..data.wordle_words import wordle_words
|
|
||||||
from ..factory import ProceduralDataset, register_dataset
|
from ..factory import ProceduralDataset, register_dataset
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -23,6 +22,9 @@ class FigletFontDataset(ProceduralDataset):
|
||||||
"""Generates FigletFont tasks"""
|
"""Generates FigletFont tasks"""
|
||||||
|
|
||||||
def __init__(self, config: FigletFontConfig):
|
def __init__(self, config: FigletFontConfig):
|
||||||
|
from ..data.wordle_words import wordle_words
|
||||||
|
|
||||||
|
self.wordle_words = wordle_words
|
||||||
self._prompt_templates = [
|
self._prompt_templates = [
|
||||||
"What word does this say?\n\n{figlet_render}",
|
"What word does this say?\n\n{figlet_render}",
|
||||||
"Please read the following figlet font:\n\n{figlet_render}",
|
"Please read the following figlet font:\n\n{figlet_render}",
|
||||||
|
|
@ -40,7 +42,7 @@ class FigletFontDataset(ProceduralDataset):
|
||||||
"""
|
"""
|
||||||
rng = Random(self.seed + idx)
|
rng = Random(self.seed + idx)
|
||||||
|
|
||||||
word = self.config.static_word if self.config.static_word is not None else rng.choice(wordle_words).upper()
|
word = self.config.static_word if self.config.static_word is not None else rng.choice(self.wordle_words).upper()
|
||||||
if self.config.space_letters:
|
if self.config.space_letters:
|
||||||
render_word = " ".join(word)
|
render_word = " ".join(word)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue