File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -39,22 +39,17 @@ def from_pretrained(
3939 return DeepseekV32Tokenizer (tokenizer )
4040
4141 def apply_chat_template (self , messages , tools = None , ** kwargs ):
42- thinking = kwargs .get ("thinking" , True )
42+ thinking = kwargs .get ("thinking" , False )
4343 thinking_mode = "thinking"
4444 if not thinking :
4545 thinking_mode = "chat"
46-
47- encode_config = dict (
48- thinking_mode = thinking_mode , drop_thinking = False , add_default_bos_token = True
49- )
50- messages .insert (
51- 0 ,
52- {
53- "role" : "system" ,
54- "content" : "You are a helpful Assistant." ,
55- "tools" : tools if tools is not None else [],
56- },
57- )
46+ messages = messages .copy ()
47+ drop_thinking = True
48+ if tools is not None and len (tools ) > 0 :
49+ messages .insert (0 , {"role" : "system" })
50+ messages [0 ]["tools" ] = tools
51+ drop_thinking = False
52+ encode_config = dict (thinking_mode = thinking_mode , drop_thinking = drop_thinking )
5853 prompt_str = encode_messages (messages , ** encode_config ) # type: ignore
5954 return prompt_str
6055
You can’t perform that action at this time.
0 commit comments