{ "backend": "tokenizers", "bos_token": "<|start▁of▁sentence|>", "clean_up_tokenization_spaces": false, "eos_token": "<|end▁of▁sentence|>", "is_local": true, "legacy": true, "local_files_only": false, "model_max_length": 262144, "pad_token": "<|▁pad▁|>", "sp_model_kwargs": {}, "tokenizer_class": "TokenizersBackend", "unk_token": "", "chat_template": "{#- 0826版本 -#}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- set enable_thinking = enable_thinking | default(true) %}\n\n{#- Render a string or a list of text blocks. -#}\n{%- macro render_content(content, context_name) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- elif content is iterable and content is not mapping %}\n {%- for block in content %}\n {%- if block.type == 'text' %}\n {{- block.text }}\n {%- else %}\n {{- raise_exception('Unsupported ' ~ context_name ~ ' content block type: ' ~ (block.type | string)) }}\n {%- endif %}\n {%- endfor %}\n {%- else %}\n {{- raise_exception(context_name ~ ' content must be a string or a list of text blocks') }}\n {%- endif %}\n{%- endmacro %}\n\n{#- Default system prompt -#}\n{%- set default_system = \"you are a helpful assistant.\" %}\n\n{#- The first message-level system is placed in the initial system block. -#}\n{%- set ns = namespace(initial_system='') %}\n{%- if messages[0].role == \"system\" %}\n {%- set ns.initial_system = render_content(messages[0].content, 'system') %}\n{%- endif %}\n\n{#- System block -#}\n{{- '<|start▁of▁sentence|><|System|>' + '\\n' + default_system }}\n{%- if tools %}\n {{- '## Tools' + '\\n' + 'You have access to the following functions:' + '\\n' + '' }}\n {%- for tool in tools %}\n {{- '\\n' + tool.function | tojson}}\n {%- endfor %}\n {{- '\\n' + '' }}\n{%- endif %}\n{%- if ns.initial_system %}\n {{- '\\n\\n' + ns.initial_system }}\n{%- endif %}\n{{- '<|end▁of▁sentence|>'}}\n\n{#- Conversation turns -#}\n{%- for message in messages %}\n {%- if message.role == \"system\" %}\n {#- The first system message was consumed by the initial block. -#}\n {%- if not loop.first %}\n {{- '<|start▁of▁sentence|><|System|>\\n' + render_content(message.content, 'system') + '<|end▁of▁sentence|>' }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|start▁of▁sentence|><|User|>' + render_content(message.content, 'user') + '<|end▁of▁sentence|>' }}\n {%- elif message.role == \"assistant\" %}\n {%- set assistant_content = render_content(message.content, 'assistant') %}\n {%- if message.reasoning_content is defined and message.reasoning_content %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- set reasoning_content = '' %}\n {%- endif %}\n {{- '<|start▁of▁sentence|><|Bot|>'}}\n {%- if reasoning_content %}\n {{- '' + reasoning_content + ''}}\n {%- else %}\n {{- '' }}\n {%- endif %}\n {%- if assistant_content %}\n {{- assistant_content }}\n {%- endif %}\n {%- if message.tool_calls is defined and message.tool_calls is not none %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function.arguments is not mapping %}\n {{- raise_exception('tool_call.function.arguments must be a dictionary; normalize JSON strings before apply_chat_template') }}\n {%- endif %}\n {%- set args = tool_call.function.arguments %}\n {{- '' + tool_call.function.name }}\n {%- for k, v in args.items() %}\n {{- '' ~ k ~ '' ~ (v if v is string else v | tojson) ~ '' }}\n {%- endfor %}\n {{- '' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|end▁of▁sentence|>' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem is undefined or loop.previtem.role != \"tool\" %}\n {{- '<|start▁of▁sentence|><|Tool|>' }}\n {%- endif %}\n {{- '' ~ message.content ~ '' }}\n {%- if loop.nextitem is undefined or loop.nextitem.role != \"tool\" %}\n {{- '<|end▁of▁sentence|>' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unsupported message role: ' ~ message.role) }}\n {%- endif %}\n{%- endfor %}\n\n{#- Generation prompt -#}\n{%- if add_generation_prompt %}\n {{- '<|start▁of▁sentence|><|Bot|>' }}\n {%- if enable_thinking is defined and enable_thinking %}\n {{- '' }}\n {%- endif %}\n {%- if enable_thinking is defined and not enable_thinking %}\n {{- '' }}\n {%- endif %}\n{%- endif %}\n" }