Vectorrent commited on
Commit
6d6025c
·
verified ·
1 Parent(s): fb3c2a1

Fix chat template: skip tool role, content before tool_calls, inline results

Browse files
Files changed (1) hide show
  1. tokenizer_config.json +3 -2
tokenizer_config.json CHANGED
@@ -31,5 +31,6 @@
31
  "extra_special_tokens": {},
32
  "model_max_length": 1000000000000000019884624838656,
33
  "pad_token": "<|endoftext|>",
34
- "tokenizer_class": "PreTrainedTokenizer"
35
- }
 
 
31
  "extra_special_tokens": {},
32
  "model_max_length": 1000000000000000019884624838656,
33
  "pad_token": "<|endoftext|>",
34
+ "tokenizer_class": "PreTrainedTokenizer",
35
+ "chat_template": "{% for message in messages %}\n{% if message['role'] == 'system' %}\n{{ bos_token }}system\n{{ message['content'] }}\n{{ sep_token }}\n{% elif message['role'] == 'developer' %}\n{{ bos_token }}developer\n{{ message['content'] }}\n{{ sep_token }}\n{% elif message['role'] == 'user' %}\n{{ bos_token }}user\n{{ message['content'] }}\n{{ sep_token }}\n{% elif message['role'] == 'assistant' %}\n{{ bos_token }}assistant\n{{ message['content'] }}\n{% if message.tool_calls is defined %}\n{% for tool_call in message.tool_calls %}\n<tool_call>\n{\"name\": \"{{ tool_call.function.name }}\", \"arguments\": {{ tool_call.function.arguments | tojson }}}\n</tool_call>\n{% endfor %}\n{% endif %}\n{{ sep_token }}\n{% endif %}\n{% endfor %}\n{% if add_generation_prompt %}\n{{ bos_token }}assistant\n{% endif %}"
36
+ }