mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
use sorted() for repeatable generation outputs (e.g. GALLERY.md)
This commit is contained in:
parent
c6634fd538
commit
a577f7cdf6
4 changed files with 30 additions and 24 deletions
|
|
@ -51,7 +51,7 @@ class LetterCountingDataset(ProceduralDataset):
|
|||
letters = {"a"} # Fallback if span has no letters
|
||||
|
||||
# Select random letter that appears in the span
|
||||
target_letter = rng.choice(list(letters))
|
||||
target_letter = rng.choice(sorted(letters))
|
||||
|
||||
# Count occurrences
|
||||
count = sum(word.lower().count(target_letter) for word in span)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class WordSortingDataset(ProceduralDataset):
|
|||
# Load and preprocess text
|
||||
text = read_data_file("in_the_year_2889.txt")
|
||||
# Extract unique words within length constraints
|
||||
self.words = list(
|
||||
self.words = sorted(
|
||||
set(
|
||||
word
|
||||
for word in re.findall(r"\b\w+\b", text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue