mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
fix prompt
This commit is contained in:
parent
50aa9608f1
commit
9f5d2e474f
1 changed files with 23 additions and 4 deletions
|
|
@ -6,6 +6,26 @@ from typing import Optional, Tuple
|
|||
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Your task is to convert a number between two different bases.
|
||||
|
||||
If the target base is > 10, use lowercase letters a-z for digits above 9.
|
||||
|
||||
Example:
|
||||
- Input: Convert the base-9 number 440 to base-5
|
||||
- Output: 2420
|
||||
- Explanation
|
||||
- First, we convert the base-9 number 440 to base-10: 4 * 9**2 + 4 * 9**1 + 0 * 9**0 = 324 + 36 + 0 = 360
|
||||
- Next, we convert the base-10 number 360 to base-5:
|
||||
- 360 // 5 = 72 remainder 0
|
||||
- 72 // 5 = 14 remainder 2
|
||||
- 14 // 5 = 2 remainder 4
|
||||
- 2 // 5 = 0 remainder 2
|
||||
- Reading the remainders in reverse order gives us the base-5 number 2 4 2 0
|
||||
- Hence, the final answer is 2420
|
||||
|
||||
Now, convert the {source_name} number {source_repr} to {target_name}
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class BaseConversionConfig:
|
||||
|
|
@ -90,11 +110,10 @@ class BaseConversionDataset(ProceduralDataset):
|
|||
source_name = self._format_base_name(source_base)
|
||||
target_name = self._format_base_name(target_base)
|
||||
|
||||
# Add hint for bases > 10 about using lowercase letters
|
||||
hint = " (use lowercase letters a-z for digits above 9)" if target_base > 10 else ""
|
||||
|
||||
return {
|
||||
"question": f"Convert the {source_name} number {source_repr} to {target_name}{hint}",
|
||||
"question": QUESTION_TEMPLATE.format(
|
||||
source_name=source_name, source_repr=source_repr, target_name=target_name
|
||||
),
|
||||
"answer": target_repr,
|
||||
"metadata": {
|
||||
"decimal_value": value,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue