diff --git a/data/preprocess_sft.ipynb b/data/preprocess_sft.ipynb index e0b183f..50da67f 100644 --- a/data/preprocess_sft.ipynb +++ b/data/preprocess_sft.ipynb @@ -42,7 +42,7 @@ "\n", "\n", "def get_prompt(data_i):\n", - " return Template(system_prompts).render(problem = data_i[\"prompt\"])\n", + " return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i[\"prompt\"])\n", "processed_data = []\n", "for i in range(len(data)):\n", " processed_data.append(\n", diff --git a/sample/dream_rl_rollout.py b/sample/dream_rl_rollout.py index 7ed742c..6772312 100644 --- a/sample/dream_rl_rollout.py +++ b/sample/dream_rl_rollout.py @@ -367,7 +367,7 @@ def random_select(data_list, random_k): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) diff --git a/sample/dream_sample.py b/sample/dream_sample.py index b8050e3..d95c8d3 100644 --- a/sample/dream_sample.py +++ b/sample/dream_sample.py @@ -360,7 +360,7 @@ def random_select(data_list, random_k): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) diff --git a/sample/llada_rl_rollout.py b/sample/llada_rl_rollout.py index 28e649e..2674481 100644 --- a/sample/llada_rl_rollout.py +++ b/sample/llada_rl_rollout.py @@ -201,7 +201,7 @@ def random_select(data_list, random_k): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) def extract_final_boxed_answer(s: str): diff --git a/sample/llada_sample.py b/sample/llada_sample.py index db764de..a08163d 100644 --- a/sample/llada_sample.py +++ b/sample/llada_sample.py @@ -201,7 +201,7 @@ def random_select(data_list, random_k): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) def extract_final_boxed_answer(s: str): diff --git a/sample/sdar_rl_rollout.py b/sample/sdar_rl_rollout.py index 4d2ad4b..9fba37b 100644 --- a/sample/sdar_rl_rollout.py +++ b/sample/sdar_rl_rollout.py @@ -39,7 +39,7 @@ def get_config(): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) def extract_final_boxed_answer(s: str): tag = r'\boxed{' diff --git a/sample/sdar_sample.py b/sample/sdar_sample.py index 1e6ee61..e2db60c 100644 --- a/sample/sdar_sample.py +++ b/sample/sdar_sample.py @@ -37,7 +37,7 @@ def get_config(): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) def extract_final_boxed_answer(s: str): tag = r'\boxed{' diff --git a/sample/trado_rl_rollout.py b/sample/trado_rl_rollout.py index 4d2ad4b..9fba37b 100644 --- a/sample/trado_rl_rollout.py +++ b/sample/trado_rl_rollout.py @@ -39,7 +39,7 @@ def get_config(): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) def extract_final_boxed_answer(s: str): tag = r'\boxed{' diff --git a/sample/trado_sample.py b/sample/trado_sample.py index 1e6ee61..e2db60c 100644 --- a/sample/trado_sample.py +++ b/sample/trado_sample.py @@ -37,7 +37,7 @@ def get_config(): # obtain prompt def get_prompt(data_i): - return Template(system_prompts).render(problem = data_i["question"]) + return Template(system_prompts, keep_trailing_newline=True).render(problem = data_i["question"]) def extract_final_boxed_answer(s: str): tag = r'\boxed{'