danielhanchen commited on
Commit
c76ea5d
·
verified ·
1 Parent(s): 94c13c5

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. config.json +1 -1
  2. generation_config.json +1 -1
  3. tokenizer_config.json +1 -1
config.json CHANGED
@@ -49,7 +49,7 @@
49
  "sliding_window": null,
50
  "tie_word_embeddings": false,
51
  "torch_dtype": "bfloat16",
52
- "transformers_version": "4.52.3",
53
  "unsloth_fixed": true,
54
  "use_cache": true,
55
  "use_sliding_window": false,
 
49
  "sliding_window": null,
50
  "tie_word_embeddings": false,
51
  "torch_dtype": "bfloat16",
52
+ "transformers_version": "4.52.4",
53
  "unsloth_fixed": true,
54
  "use_cache": true,
55
  "use_sliding_window": false,
generation_config.json CHANGED
@@ -4,5 +4,5 @@
4
  "eos_token_id": 151645,
5
  "max_length": 131072,
6
  "pad_token_id": 151654,
7
- "transformers_version": "4.52.3"
8
  }
 
4
  "eos_token_id": 151645,
5
  "max_length": 131072,
6
  "pad_token_id": 151654,
7
+ "transformers_version": "4.52.4"
8
  }
tokenizer_config.json CHANGED
@@ -240,5 +240,5 @@
240
  "tokenizer_class": "LlamaTokenizerFast",
241
  "unk_token": null,
242
  "use_default_system_prompt": false,
243
- "chat_template": "{%- if not add_generation_prompt is defined %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true, is_last_user=false) %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' %}\n {%- if ns.is_first_sp %}\n {%- set ns.system_prompt = ns.system_prompt + message['content'] %}\n {%- set ns.is_first_sp = false %}\n {%- else %}\n {%- set ns.system_prompt = ns.system_prompt + '\\n\\n' + message['content'] %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n\n{#- Adapted from https://github.com/sgl-project/sglang/blob/main/examples/chat_template/tool_chat_template_deepseekr1.jinja #}\n{%- if tools is defined and tools is not none %}\n {%- set tool_ns = namespace(text='You are a helpful assistant with tool calling capabilities. '\n 'When a tool call is needed, you MUST use the following format to issue the call:\\n'\n '<\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>function<\uff5ctool\u2581sep\uff5c>FUNCTION_NAME\\n'\n '```json\\n{\"param1\": \"value1\", \"param2\": \"value2\"}\\n```<\uff5ctool\u2581call\u2581end\uff5c><\uff5ctool\u2581calls\u2581end\uff5c>\\n\\n'\n 'Make sure the JSON is valid.'\n '## Tools\\n\\n### Function\\n\\nYou have the following functions available:\\n\\n') %}\n {%- for tool in tools %}\n {%- set tool_ns.text = tool_ns.text + '\\n```json\\n' + (tool | tojson) + '\\n```\\n' %}\n {%- endfor %}\n {%- if ns.system_prompt|length != 0 %}\n \t{%- set ns.system_prompt = ns.system_prompt + '\\n\\n' + tool_ns.text %}\n {%- else %}\n \t{%- set ns.system_prompt = tool_ns.text %}\n {%- endif %}\n{%- endif %}\n{{- bos_token }}\n{{- ns.system_prompt }}\n{%- set last_index = (messages|length - 1) %}\n{%- for message in messages %}\n {%- set content = message['content'] %}\n {%- if message['role'] == 'user' %}\n {%- set ns.is_tool = false -%}\n {%- set ns.is_first = false -%}\n {%- set ns.is_last_user = true -%}\n {%- if loop.index0 == last_index %}\n \t{{- '<\uff5cUser\uff5c>' + content }}\n {%- else %}\n \t{{- '<\uff5cUser\uff5c>' + content + '<\uff5cAssistant\uff5c>'}}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] == 'assistant' %}\n {%- if '</think>' in content %}\n {%- set content = content.split('</think>')[-1] %}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] == 'assistant' and message['tool_calls'] is defined and message['tool_calls'] is not none %}\n {%- set ns.is_last_user = false -%}\n {%- if ns.is_tool %}\n {{- '<\uff5ctool\u2581outputs\u2581end\uff5c>'}}\n {%- endif %}\n {%- set ns.is_first = false %}\n {%- set ns.is_tool = false -%}\n {%- set ns.is_output_first = true %}\n {%- for tool in message['tool_calls'] %}\n {%- if not ns.is_first %}\n {%- if content is none %}\n {{- '<\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments']|tojson + '\\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}\n {%- else %}\n {{- content + '<\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments']|tojson + '\\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}\n {%- endif %}\n {%- set ns.is_first = true -%}\n {%- else %}\n {{- '\\n' + '<\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments']|tojson + '\\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}\n {%- endif %}\n {%- endfor %}\n {{- '<\uff5ctool\u2581calls\u2581end\uff5c><\uff5cend\u2581of\u2581sentence\uff5c>'}}\n {%- endif %}\n {%- if message['role'] == 'assistant' and (message['tool_calls'] is not defined or message['tool_calls'] is none) %}\n {%- set ns.is_last_user = false -%}\n {%- if ns.is_tool %}\n {{- '<\uff5ctool\u2581outputs\u2581end\uff5c>' + content + '<\uff5cend\u2581of\u2581sentence\uff5c>'}}\n {%- set ns.is_tool = false -%}\n {%- else %}\n {{- content + '<\uff5cend\u2581of\u2581sentence\uff5c>'}}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] == 'tool' %}\n {%- set ns.is_last_user = false -%}\n {%- set ns.is_tool = true -%}\n {%- if ns.is_output_first %}\n {{- '<\uff5ctool\u2581outputs\u2581begin\uff5c><\uff5ctool\u2581output\u2581begin\uff5c>' + content + '<\uff5ctool\u2581output\u2581end\uff5c>'}}\n {%- set ns.is_output_first = false %}\n {%- else %}\n {{- '\\n<\uff5ctool\u2581output\u2581begin\uff5c>' + content + '<\uff5ctool\u2581output\u2581end\uff5c>'}}\n {%- endif %}\n {%- endif %}\n{%- endfor -%}\n{%- if ns.is_tool %}\n {{- '<\uff5ctool\u2581outputs\u2581end\uff5c>'}}\n{%- endif %}\n{#- if add_generation_prompt and not ns.is_last_user and not ns.is_tool #}\n{%- if add_generation_prompt and not ns.is_tool %}\n {{- '<\uff5cAssistant\uff5c>'}}\n{%- endif %}"
244
  }
 
240
  "tokenizer_class": "LlamaTokenizerFast",
241
  "unk_token": null,
242
  "use_default_system_prompt": false,
243
+ "chat_template": "{%- if not add_generation_prompt is defined %}\n {%- set add_generation_prompt = false %}\n{%- endif %}\n{%- set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true, is_last_user=false) %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' %}\n {%- if ns.is_first_sp %}\n {%- set ns.system_prompt = ns.system_prompt + message['content'] %}\n {%- set ns.is_first_sp = false %}\n {%- else %}\n {%- set ns.system_prompt = ns.system_prompt + '\\n\\n' + message['content'] %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n\n{#- Adapted from https://github.com/sgl-project/sglang/blob/main/examples/chat_template/tool_chat_template_deepseekr1.jinja #}\n{%- if tools is defined and tools is not none %}\n {%- set tool_ns = namespace(text='You are a helpful assistant with tool calling capabilities. '\n 'When a tool call is needed, you MUST use the following format to issue the call:\\n'\n '<\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>function<\uff5ctool\u2581sep\uff5c>FUNCTION_NAME\\n'\n '```json\\n{\"param1\": \"value1\", \"param2\": \"value2\"}\\n```<\uff5ctool\u2581call\u2581end\uff5c><\uff5ctool\u2581calls\u2581end\uff5c>\\n\\n'\n 'Make sure the JSON is valid.'\n '## Tools\\n\\n### Function\\n\\nYou have the following functions available:\\n\\n') %}\n {%- for tool in tools %}\n {%- set tool_ns.text = tool_ns.text + '\\n```json\\n' + (tool | tojson) + '\\n```\\n' %}\n {%- endfor %}\n {%- if ns.system_prompt|length != 0 %}\n {%- set ns.system_prompt = ns.system_prompt + '\\n\\n' + tool_ns.text %}\n {%- else %}\n {%- set ns.system_prompt = tool_ns.text %}\n {%- endif %}\n{%- endif %}\n{{- bos_token }}\n{{- ns.system_prompt }}\n{%- set last_index = (messages|length - 1) %}\n{%- for message in messages %}\n {%- set content = message['content'] %}\n {%- if message['role'] == 'user' %}\n {%- set ns.is_tool = false -%}\n {%- set ns.is_first = false -%}\n {%- set ns.is_last_user = true -%}\n {%- if loop.index0 == last_index %}\n {{- '<\uff5cUser\uff5c>' + content }}\n {%- else %}\n {{- '<\uff5cUser\uff5c>' + content + '<\uff5cAssistant\uff5c>'}}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] == 'assistant' %}\n {%- if '</think>' in content %}\n {%- set content = content.split('</think>')[-1] %}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] == 'assistant' and message['tool_calls'] is defined and message['tool_calls'] is not none %}\n {%- set ns.is_last_user = false -%}\n {%- if ns.is_tool %}\n {{- '<\uff5ctool\u2581outputs\u2581end\uff5c>'}}\n {%- endif %}\n {%- set ns.is_first = false %}\n {%- set ns.is_tool = false -%}\n {%- set ns.is_output_first = true %}\n {%- for tool in message['tool_calls'] %}\n {%- set arguments = tool['function']['arguments'] %}\n {%- if arguments is not string %}\n {%- set arguments = arguments|tojson %}\n {%- endif %}\n {%- if not ns.is_first %}\n {%- if content is none %}\n {{- '<\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + arguments + '\\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}\n }\n {%- else %}\n {{- content + '<\uff5ctool\u2581calls\u2581begin\uff5c><\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + arguments + '\\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}\n {%- endif %}\n {%- set ns.is_first = true -%}\n {%- else %}\n {{- '\\n' + '<\uff5ctool\u2581call\u2581begin\uff5c>' + tool['type'] + '<\uff5ctool\u2581sep\uff5c>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + arguments + '\\n' + '```' + '<\uff5ctool\u2581call\u2581end\uff5c>'}}\n {%- endif %}\n {%- endfor %}\n {{- '<\uff5ctool\u2581calls\u2581end\uff5c><\uff5cend\u2581of\u2581sentence\uff5c>'}}\n {%- endif %}\n {%- if message['role'] == 'assistant' and (message['tool_calls'] is not defined or message['tool_calls'] is none) %}\n {%- set ns.is_last_user = false -%}\n {%- if ns.is_tool %}\n {{- '<\uff5ctool\u2581outputs\u2581end\uff5c>' + content + '<\uff5cend\u2581of\u2581sentence\uff5c>'}}\n {%- set ns.is_tool = false -%}\n {%- else %}\n {{- content + '<\uff5cend\u2581of\u2581sentence\uff5c>'}}\n {%- endif %}\n {%- endif %}\n {%- if message['role'] == 'tool' %}\n {%- set ns.is_last_user = false -%}\n {%- set ns.is_tool = true -%}\n {%- if ns.is_output_first %}\n {{- '<\uff5ctool\u2581outputs\u2581begin\uff5c><\uff5ctool\u2581output\u2581begin\uff5c>' + content + '<\uff5ctool\u2581output\u2581end\uff5c>'}}\n {%- set ns.is_output_first = false %}\n {%- else %}\n {{- '\\n<\uff5ctool\u2581output\u2581begin\uff5c>' + content + '<\uff5ctool\u2581output\u2581end\uff5c>'}}\n {%- endif %}\n {%- endif %}\n{%- endfor -%}\n{%- if ns.is_tool %}\n {{- '<\uff5ctool\u2581outputs\u2581end\uff5c>'}}\n{%- endif %}\n{#- if add_generation_prompt and not ns.is_last_user and not ns.is_tool #}\n{%- if add_generation_prompt and not ns.is_tool %}\n {{- '<\uff5cAssistant\uff5c>'}}\n{%- endif %}"
244
  }