| { |
| "audio_token": "<|audio|>", |
| "backend": "tokenizers", |
| "boa_token": "<|audio>", |
| "boi_token": "<|image>", |
| "bos_token": "<bos>", |
| "eoa_token": "<audio|>", |
| "eoc_token": "<channel|>", |
| "eoi_token": "<image|>", |
| "eos_token": "<eos>", |
| "eot_token": "<turn|>", |
| "escape_token": "<|\"|>", |
| "etc_token": "<tool_call|>", |
| "etd_token": "<tool|>", |
| "etr_token": "<tool_response|>", |
| "extra_special_tokens": [ |
| "<|video|>" |
| ], |
| "image_token": "<|image|>", |
| "is_local": false, |
| "local_files_only": false, |
| "mask_token": "<mask>", |
| "model_max_length": 262144, |
| "model_specific_special_tokens": { |
| "audio_token": "<|audio|>", |
| "boa_token": "<|audio>", |
| "boi_token": "<|image>", |
| "eoa_token": "<audio|>", |
| "eoc_token": "<channel|>", |
| "eoi_token": "<image|>", |
| "eot_token": "<turn|>", |
| "escape_token": "<|\"|>", |
| "etc_token": "<tool_call|>", |
| "etd_token": "<tool|>", |
| "etr_token": "<tool_response|>", |
| "image_token": "<|image|>", |
| "soc_token": "<|channel>", |
| "sot_token": "<|turn>", |
| "stc_token": "<|tool_call>", |
| "std_token": "<|tool>", |
| "str_token": "<|tool_response>", |
| "think_token": "<|think|>" |
| }, |
| "pad_token": "<pad>", |
| "padding_side": "right", |
| "processor_class": "Gemma4Processor", |
| "response_schema": { |
| "properties": { |
| "content": { |
| "type": "string" |
| }, |
| "role": { |
| "const": "assistant" |
| }, |
| "thinking": { |
| "type": "string" |
| }, |
| "tool_calls": { |
| "items": { |
| "properties": { |
| "function": { |
| "properties": { |
| "arguments": { |
| "additionalProperties": {}, |
| "type": "object", |
| "x-parser": "gemma4-tool-call" |
| }, |
| "name": { |
| "type": "string" |
| } |
| }, |
| "type": "object", |
| "x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})" |
| }, |
| "type": { |
| "const": "function" |
| } |
| }, |
| "type": "object" |
| }, |
| "type": "array", |
| "x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>" |
| } |
| }, |
| "type": "object", |
| "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?" |
| }, |
| "soc_token": "<|channel>", |
| "sot_token": "<|turn>", |
| "stc_token": "<|tool_call>", |
| "std_token": "<|tool>", |
| "str_token": "<|tool_response>", |
| "think_token": "<|think|>", |
| "tokenizer_class": "GemmaTokenizer", |
| "unk_token": "<unk>", |
| "added_tokens_decoder": { |
| "0": { |
| "content": "<pad>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "1": { |
| "content": "<eos>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "2": { |
| "content": "<bos>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "3": { |
| "content": "<unk>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "4": { |
| "content": "<mask>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "46": { |
| "content": "<|tool>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "47": { |
| "content": "<tool|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "48": { |
| "content": "<|tool_call>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "49": { |
| "content": "<tool_call|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "50": { |
| "content": "<|tool_response>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "51": { |
| "content": "<tool_response|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "52": { |
| "content": "<|\"|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "98": { |
| "content": "<|think|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "100": { |
| "content": "<|channel>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "101": { |
| "content": "<channel|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "105": { |
| "content": "<|turn>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "106": { |
| "content": "<turn|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "255999": { |
| "content": "<|image>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "256000": { |
| "content": "<|audio>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "258880": { |
| "content": "<|image|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "258881": { |
| "content": "<|audio|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "258882": { |
| "content": "<image|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "258883": { |
| "content": "<audio|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| }, |
| "258884": { |
| "content": "<|video|>", |
| "single_word": false, |
| "lstrip": false, |
| "rstrip": false, |
| "normalized": false, |
| "special": true |
| } |
| }, |
| "chat_template": "{{ bos_token }}{%- macro strip_thinking(text) -%}\n {%- set ns = namespace(result='') -%}\n {%- for part in text.split('<channel|>') -%}\n {%- if '<|channel>' in part -%}\n {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}\n {%- else -%}\n {%- set ns.result = ns.result + part -%}\n {%- endif -%}\n {%- endfor -%}\n {{- ns.result | trim -}}\n{%- endmacro -%}\n{%- set thinking = enable_thinking is defined and enable_thinking -%}\n{%- set loop_messages = messages -%}\n{%- if messages[0]['role'] in ['system', 'developer'] or thinking -%}\n {{ '<|turn>system\n' }}\n {%- if thinking -%}\n {{ '<|think|>\n' }}\n {%- endif -%}\n {%- if messages[0]['role'] in ['system', 'developer'] -%}\n {{ messages[0]['content'] | trim }}\n {%- set loop_messages = messages[1:] -%}\n {%- endif -%}\n {{ '<turn|>\n' }}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<|turn>' + role + '\n' }}\n {%- if message['content'] is string -%}\n {%- if role == \"model\" -%}\n {{ strip_thinking(message['content']) }}\n {%- else -%}\n {{ message['content'] | trim }}\n {%- endif -%}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'audio' -%}\n {{ '<|audio|>' }}\n {%- elif item['type'] == 'image' -%}\n {{ '<|image|>' }}\n {%- elif item['type'] == 'video' -%}\n {{ '<|video|>' }}\n {%- elif item['type'] == 'text' -%}\n {%- if role == \"model\" -%}\n {{ strip_thinking(item['text']) }}\n {%- else -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<turn|>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<|turn>model\n'}}\n {%- if not thinking -%}\n {{ '<|channel>thought\n<channel|>' }}\n {%- endif -%}\n{%- endif -%}\n" |
| } |