| { |
| "add_prefix_space": false, |
| "backend": "tokenizers", |
| "bos_token": "<|endoftext|>", |
| "clean_up_tokenization_spaces": false, |
| "eos_token": "<|endoftext|>", |
| "is_local": false, |
| "local_files_only": false, |
| "model_max_length": 65536, |
| "pad_token": "<|pad|>", |
| "tokenizer_class": "TokenizersBackend", |
| "unk_token": "<|endoftext|>", |
| "chat_template": "{% set has_system = messages|selectattr('role', 'equalto', 'system')|list|length > 0 %}{% if not has_system %}{{ '<|im_start|>system\nYou are a helpful AI assistant.<|im_end|>\n' }}{% endif %}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|im_start|>system\n' + message['content'] }}{% if tools is defined and tools %}{{ ' <functions>' }}{{ tools | tojson }}{{ '</functions><|im_end|>\n' }}{% elif message.get('functions', none) is not none %}{{ ' <functions>' }}{{ message['functions'] }}{{ '</functions><|im_end|>\n' }}{% else %}{{ ' You do not currently have access to any functions. <functions></functions><|im_end|>\n' }}{% endif %}{% elif message['role'] == 'user' %}{% if message.get('functions', none) is not none %}{{ '<|im_start|>user\n' + message['content'] + '\n' + '<functions>' + message['functions'] + '</functions><|im_end|>\n' }}{% else %}{{ '<|im_start|>user\n' + message['content'] + '<|im_end|>\n' }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '<|im_start|>assistant\n' }}{% if message.get('content', none) is not none %}{{ message['content'] }}{% endif %}{% if message.get('function_calls', none) is not none %}{{ '<function_calls>' + message['function_calls'] + '</function_calls>' }}{% elif message.get('tool_calls', none) is not none %}{{ '<function_calls>' }}{%- for tc in message['tool_calls'] %}{%- if tc is mapping and tc.get('function', none) is not none %}{%- set a = tc['function']['arguments'] %}{%- set ns = namespace(al=[]) %}{%- for k,v in a.items() %}{%- set ns.al = ns.al + [k ~ '=' ~ (v | tojson)] %}{%- endfor %}{{- tc['function']['name'] + '(' + (ns.al | join(', ')) + ')' }}{%- if not loop.last %}{{ '\n' }}{%- endif %}{%- else %}{{ tc }}{%- endif %}{%- endfor %}{{ '</function_calls>' }}{% endif %}{% if not loop.last %}{{ '<|im_end|>' + '\n' }}{% else %}{{ eos_token }}{% endif %}{% elif message['role'] == 'environment' %}{{ '<|im_start|>environment\n' + message['content'] + '<|im_end|>\n' }}{% elif message['role'] == 'tool' %}{{ '<|im_start|>environment\n' + message['content'] + '<|im_end|>\n' }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|im_start|>assistant\n<think>' }}{% endif %}{% endfor %}" |
| } |