dots-studio/dots3-note-prev · Hugging Face
Log In<br>Sign Up
","pad_token":"","unk_token":null},"chat_template_jinja":"{%- if enable_thinking is not defined -%}\n {%- set enable_thinking = true -%}\n{%- endif -%}\n{%- if clear_thinking is not defined -%}\n {%- set clear_thinking = false -%}\n{%- endif -%}\n\n{%- set image_count = namespace(value=0) -%}\n{%- set audio_count = namespace(value=0) -%}\n{%- set video_count = namespace(value=0) -%}\n{%- set last_user_index = namespace(value=-1) -%}\n\n{%- macro render_content(content) -%}\n {%- if not content -%}\n {{- '' -}}\n {%- elif content is string -%}\n {{- content -}}\n {%- else -%}\n {%- for item in content -%}\n {%- if item['type'] == 'image' or 'image' in item or 'image_url' in item -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- if not loop.first -%}{{- '\\n' -}}{%- endif -%}\n {%- if add_vision_id -%}Picture {{ image_count.value }}: {% endif -%}\n \n {%- elif item['type'] == 'video' or 'video' in item or 'video_url' in item -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- if not loop.first -%}{{- '\\n' -}}{%- endif -%}\n {%- if add_vision_id -%}Video {{ video_count.value }}: {% endif -%}\n \n {%- elif item['type'] == 'audio' or 'audio' in item or 'audio_url' in item -%}\n {%- set audio_count.value = audio_count.value + 1 -%}\n {%- if not loop.first -%}{{- '\\n' -}}{%- endif -%}\n {%- if add_vision_id -%}Audio {{ audio_count.value }}: {% endif -%}\n \n {%- elif 'text' in item -%}\n {{- item['text'] -}}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- if tools -%}\n {{- '' -}}\n {%- if messages[0]['role'] == 'system' -%}\n {{- render_content(messages[0]['content']) -}}\n {%- else -%}\n {{- 'You are a helpful assistant.' -}}\n {%- endif -%}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within XML tags:\\n\" -}}\n {%- for tool in tools -%}\n {{- \"\\n\" -}}\n {{- tool | tojson -}}\n {%- endfor -%}\n {{- \"\\n\\n\\nWhen making tool calls, use XML format to invoke tools and pass parameters:\\n\\n\\n\\n\\nparam-value-1\\n\\n\\nparam-value-2\\n\\n...\\n\\n\" -}}\n{%- else -%}\n {%- if messages[0]['role'] == 'system' -%}\n {{- '' -}}\n {{- render_content(messages[0]['content']) -}}\n {{- '' -}}\n {%- else -%}\n {{- 'You are a helpful assistant.' -}}\n {%- endif -%}\n{%- endif -%}\n\n{%- for m in messages -%}\n {%- if m['role'] == 'user' -%}\n {%- set last_user_index.value = loop.index0 -%}\n {%- endif -%}\n{%- endfor -%}\n\n{%- for message in messages -%}\n {%- set content = render_content(message['content']) -%}\n {%- if (message['role'] == 'user') or (message['role'] == 'system' and not loop.first) -%}\n {{- '' -}}\n {{- content -}}\n {%- if message['role'] == 'user' and enable_thinking is false and not content.endswith('') -%}\n {{- '' -}}\n {%- endif -%}\n {{- '' -}}\n {%- elif message['role'] == 'assistant' -%}\n {%- set reasoning_content = '' -%}\n {%- if message.reasoning_content is string -%}\n {%- set reasoning_content = message.reasoning_content -%}\n {%- else -%}\n {%- if '' in content -%}\n {%- set reasoning_content = content.split('')[0].rstrip('\\n').split('')[-1].lstrip('\\n') -%}\n {%- set content = content.split('')[-1].lstrip('\\n') -%}\n {%- endif -%}\n {%- endif -%}\n {%- set reasoning_content = reasoning_content|trim -%}\n {{- '' -}}\n {%- if enable_thinking is false -%}\n {{- '\\n\\n\\n\\n' + content -}}\n {%- elif clear_thinking and loop.index0 \\n\\n\\n\\n' + content -}}\n {%- elif reasoning_content -%}\n {{- '\\n' + reasoning_content + '\\n\\n\\n' + content -}}\n {%- else -%}\n {{- content -}}\n {%- endif -%}\n {%- if message.get('tool_calls') -%}\n {%- for tool_call in message['tool_calls'] -%}\n {%- if tool_call.function is defined -%}\n {%- set tool_call = tool_call.function -%}\n {%- endif -%}\n {{- '\\n\\n' -}}\n {%- for arg_name, arg_value in tool_call.arguments.items() -%}\n {{- '\\n' -}}\n {{- '\\n' -}}\n {%- if arg_value is string -%}\n {{- arg_value -}}\n {%- else -%}\n {{- arg_value|tojson -}}\n {%- endif -%}\n {{- '\\n' -}}\n {{- '' -}}\n {%- endfor -%}\n {{- '\\n\\n' -}}\n {%- endfor -%}\n {%- endif -%}\n {{- '' -}}\n {%- elif message['role'] == 'tool' -%}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1]['role'] != 'tool') -%}\n {{- '' -}}\n {%- endif -%}\n {{- '\\n\\n' -}}\n {{- content -}}\n {{- '\\n' -}}\n {%- if loop.last or (messages[loop.index0 + 1]['role'] != 'tool') -%}\n {{- '' -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n\n{%- if add_generation_prompt -%}\n {{- '' -}}\n {%- if enable_thinking is false -%}\n {{- '\\n\\n\\n\\n' -}}\n {%- endif -%}\n{%- endif...