mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
fix unit tests, lower python dependency to 3.9
This commit is contained in:
parent
ee67374aae
commit
ad9f0d265c
11 changed files with 66 additions and 56 deletions
|
|
@ -82,17 +82,16 @@ class FractionSimplificationDataset(ProceduralDataset):
|
|||
|
||||
def _format_fraction(self, num: int, den: int, style: str = "plain") -> str:
|
||||
"""Format a fraction in various styles"""
|
||||
match style:
|
||||
case "plain":
|
||||
return f"{num}/{den}"
|
||||
case "latex_inline":
|
||||
return f"${num}/{den}$"
|
||||
case "latex_frac":
|
||||
return f"$\\frac{{{num}}}{{{den}}}$"
|
||||
case "latex_dfrac":
|
||||
return f"$\\dfrac{{{num}}}{{{den}}}$"
|
||||
case _:
|
||||
raise ValueError(f"Unknown fraction style: {style}")
|
||||
if style == "plain":
|
||||
return f"{num}/{den}"
|
||||
elif style == "latex_inline":
|
||||
return f"${num}/{den}$"
|
||||
elif style == "latex_frac":
|
||||
return f"$\\frac{{{num}}}{{{den}}}$"
|
||||
elif style == "latex_dfrac":
|
||||
return f"$\\dfrac{{{num}}}{{{den}}}$"
|
||||
else:
|
||||
raise ValueError(f"Unknown fraction style: {style}")
|
||||
|
||||
def __getitem__(self, idx: int) -> dict:
|
||||
"""Generate a single fraction simplification task"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue