tc-mb commited on
Commit
540fac8
·
verified ·
1 Parent(s): 5a7dc0a
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- macro render_content(content, is_system_content=false) -%}
2
+ {%- if content is string -%}
3
+ {{- content -}}
4
+ {%- elif content is iterable and content is not mapping -%}
5
+ {%- set ns = namespace(parts=[]) -%}
6
+ {%- for item in content -%}
7
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' -%}
8
+ {%- if is_system_content -%}
9
+ {{- raise_exception('System message cannot contain images.') -}}
10
+ {%- endif -%}
11
+ {%- set ns.parts = ns.parts + ['<|image_pad|>'] -%}
12
+ {%- elif 'video' in item or item.type == 'video' -%}
13
+ {%- if is_system_content -%}
14
+ {{- raise_exception('System message cannot contain videos.') -}}
15
+ {%- endif -%}
16
+ {%- set ns.parts = ns.parts + ['<|video_pad|>'] -%}
17
+ {%- elif 'text' in item -%}
18
+ {%- set ns.parts = ns.parts + [item.text] -%}
19
+ {%- else -%}
20
+ {{- raise_exception('Unexpected item type in content.') -}}
21
+ {%- endif -%}
22
+ {%- endfor -%}
23
+ {{- ns.parts | join('\n') -}}
24
+ {%- elif content is none or content is undefined -%}
25
+ {{- '' -}}
26
+ {%- else -%}
27
+ {{- raise_exception('Unexpected content type.') -}}
28
+ {%- endif -%}
29
+ {%- endmacro -%}
30
+ {%- if not messages %}
31
+ {{- raise_exception('No messages provided.') }}
32
+ {%- endif %}
33
+ {%- if tools and tools is iterable and tools is not mapping %}
34
+ {{- '<|im_start|>system\n' }}
35
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
36
+ {%- for tool in tools %}
37
+ {{- "\n" }}
38
+ {{- tool | tojson }}
39
+ {%- endfor %}
40
+ {{- "\n</tools>" }}
41
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
42
+ {%- if messages[0].role == 'system' %}
43
+ {%- set content = render_content(messages[0].content, true)|trim %}
44
+ {%- if content %}
45
+ {{- '\n\n' + content }}
46
+ {%- endif %}
47
+ {%- endif %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- else %}
50
+ {%- if messages[0].role == 'system' %}
51
+ {%- set content = render_content(messages[0].content, true)|trim %}
52
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
53
+ {%- endif %}
54
+ {%- endif %}
55
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
56
+ {%- for message in messages[::-1] %}
57
+ {%- set index = (messages|length - 1) - loop.index0 %}
58
+ {%- if ns.multi_step_tool and message.role == "user" %}
59
+ {%- set content = render_content(message.content)|trim %}
60
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
61
+ {%- set ns.multi_step_tool = false %}
62
+ {%- set ns.last_query_index = index %}
63
+ {%- endif %}
64
+ {%- endif %}
65
+ {%- endfor %}
66
+ {%- if ns.multi_step_tool %}
67
+ {{- raise_exception('No user query found in messages.') }}
68
+ {%- endif %}
69
+ {%- for message in messages %}
70
+ {%- set content = render_content(message.content)|trim %}
71
+ {%- if message.role == "system" %}
72
+ {%- if not loop.first %}
73
+ {{- raise_exception('System message must be at the beginning.') }}
74
+ {%- endif %}
75
+ {%- elif message.role == "user" %}
76
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
77
+ {%- elif message.role == "assistant" %}
78
+ {%- set reasoning_content = '' %}
79
+ {%- if message.reasoning_content is string %}
80
+ {%- set reasoning_content = message.reasoning_content %}
81
+ {%- else %}
82
+ {%- if '</think>' in content %}
83
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
84
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
85
+ {%- endif %}
86
+ {%- endif %}
87
+ {%- set reasoning_content = reasoning_content|trim %}
88
+ {%- if loop.index0 > ns.last_query_index and reasoning_content %}
89
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
90
+ {%- else %}
91
+ {{- '<|im_start|>' + message.role + '\n<think>\n\n</think>\n\n' + content }}
92
+ {%- endif %}
93
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
94
+ {%- for tool_call in message.tool_calls %}
95
+ {%- if tool_call.function is defined %}
96
+ {%- set tool_call = tool_call.function %}
97
+ {%- endif %}
98
+ {%- if loop.first %}
99
+ {%- if content|trim %}
100
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
101
+ {%- else %}
102
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
103
+ {%- endif %}
104
+ {%- else %}
105
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
106
+ {%- endif %}
107
+ {%- if tool_call.arguments is defined %}
108
+ {%- for args_name, args_value in tool_call.arguments|items %}
109
+ {{- '<parameter=' + args_name + '>\n' }}
110
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
111
+ {{- args_value }}
112
+ {{- '\n</parameter>\n' }}
113
+ {%- endfor %}
114
+ {%- endif %}
115
+ {{- '</function>\n</tool_call>' }}
116
+ {%- endfor %}
117
+ {%- endif %}
118
+ {{- '<|im_end|>\n' }}
119
+ {%- elif message.role == "tool" %}
120
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
121
+ {{- '<|im_start|>user' }}
122
+ {%- endif %}
123
+ {{- '\n<tool_response>\n' }}
124
+ {{- content }}
125
+ {{- '\n</tool_response>' }}
126
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
127
+ {{- '<|im_end|>\n' }}
128
+ {%- elif loop.last %}
129
+ {{- '<|im_end|>\n' }}
130
+ {%- endif %}
131
+ {%- else %}
132
+ {{- raise_exception('Unexpected message role.') }}
133
+ {%- endif %}
134
+ {%- endfor %}
135
+ {%- if add_generation_prompt %}
136
+ {{- '<|im_start|>assistant\n' }}
137
+ {%- if enable_thinking is defined and enable_thinking is false %}
138
+ {{- '<think>\n\n</think>\n\n' }}
139
+ {%- else %}
140
+ {{- '<think>\n' }}
141
+ {%- endif %}
142
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MiniCPMV4_7ForConditionalGeneration"
4
+ ],
5
+ "dtype": "bfloat16",
6
+ "model_type": "minicpmv4_7",
7
+ "tie_word_embeddings": false,
8
+ "transformers_version": "5.2.0",
9
+ "use_cache": true,
10
+ "text_config": {
11
+ "attention_bias": false,
12
+ "attention_dropout": 0.0,
13
+ "attn_output_gate": true,
14
+ "full_attention_interval": 4,
15
+ "head_dim": 256,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 1024,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 3584,
20
+ "layer_types": [
21
+ "linear_attention",
22
+ "linear_attention",
23
+ "linear_attention",
24
+ "full_attention",
25
+ "linear_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "full_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "full_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "full_attention",
37
+ "linear_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "full_attention",
41
+ "linear_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "full_attention"
45
+ ],
46
+ "linear_conv_kernel_dim": 4,
47
+ "linear_key_head_dim": 128,
48
+ "linear_num_key_heads": 16,
49
+ "linear_num_value_heads": 16,
50
+ "linear_value_head_dim": 128,
51
+ "mamba_ssm_dtype": "float32",
52
+ "max_position_embeddings": 262144,
53
+ "mlp_only_layers": [],
54
+ "mtp_num_hidden_layers": 1,
55
+ "mtp_use_dedicated_embeddings": false,
56
+ "num_attention_heads": 8,
57
+ "num_hidden_layers": 24,
58
+ "num_key_value_heads": 2,
59
+ "partial_rotary_factor": 0.25,
60
+ "rms_norm_eps": 1e-06,
61
+ "rope_parameters": {
62
+ "mrope_interleaved": true,
63
+ "mrope_section": [
64
+ 11,
65
+ 11,
66
+ 10
67
+ ],
68
+ "partial_rotary_factor": 0.25,
69
+ "rope_theta": 10000000,
70
+ "rope_type": "default"
71
+ },
72
+ "vocab_size": 248094,
73
+ "model_type": "qwen3_5_text",
74
+ "tie_word_embeddings": false
75
+ },
76
+ "insert_layer_id": 6,
77
+ "downsample_mode": "16x",
78
+ "mrope_mode": "canvas",
79
+ "vision_config": {
80
+ "attention_dropout": 0.0,
81
+ "hidden_act": "gelu_pytorch_tanh",
82
+ "hidden_size": 1152,
83
+ "image_size": 980,
84
+ "intermediate_size": 4304,
85
+ "layer_norm_eps": 1e-06,
86
+ "model_type": "minicpmv4_7_vision",
87
+ "num_attention_heads": 16,
88
+ "num_channels": 3,
89
+ "num_hidden_layers": 27,
90
+ "patch_size": 14
91
+ },
92
+ "image_token_id": 248056,
93
+ "video_token_id": 248057,
94
+ "version": 4.1
95
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eos_token_id": [
3
+ 248044,
4
+ 248046
5
+ ],
6
+ "transformers_version": "5.2.0",
7
+ "use_cache": true,
8
+ "bos_token_id": 248045
9
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c4921ac83182c85190ad10c3aeb118d51e385d2d98ec13b88b514bbf6cac002
3
+ size 3109054480
preprocessor_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor_type": "MiniCPMV4_7ImageProcessor",
3
+ "processor_class": "MiniCPMV4_7Processor",
4
+ "max_slice_nums": 9,
5
+ "image_mean": [
6
+ 0.5,
7
+ 0.5,
8
+ 0.5
9
+ ],
10
+ "image_std": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "mrope_mode": "canvas",
16
+ "auto_map": {
17
+ "AutoImageProcessor": "image_processing_minicpmv4_7.MiniCPMV4_7ImageProcessor",
18
+ "AutoVideoProcessor": "video_processing_minicpmv4_7.MiniCPMV4_7VideoProcessor"
19
+ }
20
+ }
processor_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoProcessor": "processing_minicpmv4_7.MiniCPMV4_7Processor"
4
+ },
5
+ "processor_class": "MiniCPMV4_7Processor"
6
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33861e37bb955af1e3f3061182b820f347eba2b9c2c1011c82794bf0d6e77b54
3
+ size 19992481
tokenizer_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": "<|im_start|>",
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "extra_special_tokens": {
12
+ "image_token": "<|image_pad|>",
13
+ "video_token": "<|video_pad|>",
14
+ "image_start_token": "<image>",
15
+ "image_end_token": "</image>",
16
+ "slice_start_token": "<slice>",
17
+ "slice_end_token": "</slice>",
18
+ "image_id_start_token": "<image_id>",
19
+ "image_id_end_token": "</image_id>"
20
+ },
21
+ "image_token": "<|image_pad|>",
22
+ "is_local": true,
23
+ "model_max_length": 262144,
24
+ "model_specific_special_tokens": {
25
+ "audio_bos_token": "<|audio_start|>",
26
+ "audio_eos_token": "<|audio_end|>",
27
+ "audio_token": "<|audio_pad|>",
28
+ "image_token": "<|image_pad|>",
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ },
33
+ "pad_token": "<|endoftext|>",
34
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
35
+ "split_special_tokens": false,
36
+ "tokenizer_class": "Qwen2Tokenizer",
37
+ "unk_token": "<unk>",
38
+ "video_token": "<|video_pad|>",
39
+ "vision_bos_token": "<|vision_start|>",
40
+ "vision_eos_token": "<|vision_end|>",
41
+ "chat_template": "{%- macro render_content(content, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- set ns = namespace(parts=[]) -%}\n {%- for item in content -%}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- set ns.parts = ns.parts + ['<|image_pad|>'] -%}\n {%- elif 'video' in item or item.type == 'video' -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- set ns.parts = ns.parts + ['<|video_pad|>'] -%}\n {%- elif 'text' in item -%}\n {%- set ns.parts = ns.parts + [item.text] -%}\n {%- else -%}\n {{- raise_exception('Unexpected item type in content.') -}}\n {%- endif -%}\n {%- endfor -%}\n {{- ns.parts | join('\\n') -}}\n {%- elif content is none or content is undefined -%}\n {{- '' -}}\n {%- else -%}\n {{- raise_exception('Unexpected content type.') -}}\n {%- endif -%}\n{%- endmacro -%}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, true)|trim %}\n {%- if content %}\n {{- '\\n\\n' + content }}\n {%- endif %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, true)|trim %}\n {{- '<|im_start|>system\\n' + content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" %}\n {%- set content = render_content(message.content)|trim %}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if ns.multi_step_tool %}\n {{- raise_exception('No user query found in messages.') }}\n{%- endif %}\n{%- for message in messages %}\n {%- set content = render_content(message.content)|trim %}\n {%- if message.role == \"system\" %}\n {%- if not loop.first %}\n {{- raise_exception('System message must be at the beginning.') }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\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 '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if loop.index0 > ns.last_query_index and reasoning_content %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n\\n</think>\\n\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\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 {%- if loop.first %}\n {%- if content|trim %}\n {{- '\\n\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- else %}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- if tool_call.arguments is defined %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unexpected message role.') }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- else %}\n {{- '<think>\\n' }}\n {%- endif %}\n{%- endif %}\n"
42
+ }