File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed
Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ PYTHONPATH="${PYTHONPATH}:src/" poetry run accelerate launch --config_file accel
215215 - " lm_head"
216216 lora_r : 256
217217 lora_alpha : 256
218+ enable_thinking : False # set True if the model and dataset supports thinking
218219 assistant_message_template : " <|start_header_id|>assistant<|end_header_id|>\n\n "
219220 custom_pad_token : " <|reserved_special_token_0|>"
220221 custom_eos_token : " <|eot_id|>"
Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ def process_row(row, add_gen_prompt=False):
9494 constructed_prompt = tokenizer .apply_chat_template (
9595 system_message + history ,
9696 tokenize = False ,
97- add_generation_prompt = add_gen_prompt
97+ add_generation_prompt = add_gen_prompt ,
98+ enable_thinking = args .enable_thinking
9899 )
99100 if tokenizer .bos_token is not None :
100101 if constructed_prompt .startswith (tokenizer .bos_token ): # Remove extra bos token
Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ def process_row(row, add_gen_prompt=False):
100100 constructed_prompt = tokenizer .apply_chat_template (
101101 system_message + history ,
102102 tokenize = False ,
103- add_generation_prompt = add_gen_prompt
103+ add_generation_prompt = add_gen_prompt ,
104+ enable_thinking = args .enable_thinking
104105 )
105106 if tokenizer .bos_token is not None :
106107 if constructed_prompt .startswith (tokenizer .bos_token ): # Remove extra bos token
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ class SFTScriptArguments(CommonScriptArguments):
1717 "help" : "Will use system prompt if there is no one in dialogue, set to None to disable"
1818 },
1919 )
20+ enable_thinking : bool | None = field (
21+ default = False , metadata = {"help" : "Do train with thinking" }
22+ )
2023 train_only_on_completions : bool | None = field (
2124 default = True , metadata = {"help" : "Do train only on completions or not" }
2225 )
You can’t perform that action at this time.
0 commit comments