Skip to content

Commit

Permalink
make tasks harder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayi-Pan committed Jan 22, 2025
1 parent 268cce7 commit e189fa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions examples/data_preprocess/arth.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ def gen_dataset(
seed(1)
# Generate N pairs of numbers and their results for different operations
equations = []
operations = ['*', '+', '-', '*', '*']
# operations = ['*', '+', '-', '*', '*']
operations = ['*']
for _ in tqdm(range(N)):
# Helper function to generate a number with 50% chance of being N-digit or N/2-digit
def get_random_num():
r = randint(0,3)
r = randint(1,3)
if r == 0:
# 2 digits less than original
max_num = 10**(DIGIT-2)
Expand Down Expand Up @@ -79,7 +80,7 @@ def make_prefix(dp):
num1 = dp['num1']
num2 = dp['num2']
op = dp['operation']
prefix = f"""A conversation between User and Assistant. The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> RESULT_NUMBER </answer>. \nUser: Give me the answer of the following equation: {num1} {op} {num2}.\nAssistant: Ok let me think about it.\n<think>"""
prefix = f"""A conversation between User and Assistant. The user asks a question, and the Assistant solves it. The assistant first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e., <think> reasoning process here </think> <answer> RESULT_NUMBER </answer>. \nUser: Give me the answer of the following equation: {num1} {op} {num2}.\nAssistant: Let me solve this step by step.\n<think>"""
return prefix

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion examples/data_preprocess/multiply.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def gen_dataset(
for _ in tqdm(range(N)):
# Helper function to generate a number with 50% chance of being N-digit or N/2-digit
def get_random_num():
r = randint(0,3)
r = randint(,3)
if r == 0:
# 2 digits less than original
max_num = 10**(DIGIT-2)
Expand Down

0 comments on commit e189fa2

Please sign in to comment.