mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
formatting, cleanup
This commit is contained in:
parent
b767e58e48
commit
3dc80be7d2
12 changed files with 189 additions and 376 deletions
|
|
@ -39,7 +39,7 @@ class GCDDataset(ProceduralDataset):
|
|||
def _generate_numbers(self, rng: Random) -> Tuple[List[int], int]:
|
||||
"""Generate a list of random positive integers and their GCD.
|
||||
Will try up to 3 times to find numbers with GCD > 1."""
|
||||
|
||||
|
||||
# Try up to 3 times to get GCD > 1
|
||||
for _ in range(3):
|
||||
num_count = rng.randint(self.config.min_numbers, self.config.max_numbers)
|
||||
|
|
@ -47,7 +47,7 @@ class GCDDataset(ProceduralDataset):
|
|||
result = reduce(gcd, numbers)
|
||||
if result > 1:
|
||||
break
|
||||
|
||||
|
||||
# Return the last generated numbers, whether they met the criteria or not
|
||||
return numbers, result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue