naksyu commited on
Commit
9928019
ยท
verified ยท
1 Parent(s): 614e006

Upload 4 files

Browse files
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* 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
  gemma4_e4b_lime_persona500_Q6_K.gguf 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
  gemma4_e4b_lime_persona500_Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
37
+ gemma4_e4b_lime_persona500_Q6_K_limechat.gguf filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -34,8 +34,9 @@ This is not an official Google or Google DeepMind release.
34
  - Training target: Korean daily conversation, logic, reasoning, persona identity, and concise assistant responses
35
  - Export format: GGUF
36
  - Quantization: Q6_K
37
- - Final file: `gemma4_e4b_lime_persona500_Q6_K.gguf`
38
- - Optional Lime chat template: `chat_template_lime.jinja`
 
39
  - Approximate GGUF size: 6.22 GB
40
 
41
  ## Recommended System Prompt
@@ -78,14 +79,14 @@ Better wording for "Who made you?" style prompts:
78
  .\llama-server.exe -m .\gemma4_e4b_lime_persona500_Q6_K.gguf --alias lime-q6 --host 127.0.0.1 --port 8080 -c 8192 -ngl 99
79
  ```
80
 
81
- `chat_template_lime.jinja` is provided as an optional Gemma 4-compatible chat template variant. It keeps the original Gemma 4 turn/tool structure, but prepends a Lime-specific system policy that:
82
 
83
  - separates the Gemma 4 E4B base model from the Lime persona
84
  - discourages false claims about being an independent official model
85
  - asks the model not to invent current time, tools, memory, or missing source text
86
  - keeps final answers separate from internal reasoning
87
 
88
- Use it only in runtimes that support custom Jinja chat templates. The GGUF file may still contain the template that was embedded at conversion time, depending on how the serving runtime loads metadata.
89
 
90
  Then call the OpenAI-compatible endpoint:
91
 
 
34
  - Training target: Korean daily conversation, logic, reasoning, persona identity, and concise assistant responses
35
  - Export format: GGUF
36
  - Quantization: Q6_K
37
+ - Recommended GGUF file: `gemma4_e4b_lime_persona500_Q6_K_limechat.gguf`
38
+ - Original Q6_K GGUF before metadata patch: `gemma4_e4b_lime_persona500_Q6_K.gguf`
39
+ - Standalone Lime chat template: `chat_template_lime.jinja`
40
  - Approximate GGUF size: 6.22 GB
41
 
42
  ## Recommended System Prompt
 
79
  .\llama-server.exe -m .\gemma4_e4b_lime_persona500_Q6_K.gguf --alias lime-q6 --host 127.0.0.1 --port 8080 -c 8192 -ngl 99
80
  ```
81
 
82
+ `gemma4_e4b_lime_persona500_Q6_K_limechat.gguf` includes the Lime chat template in GGUF metadata. `chat_template_lime.jinja` is also provided as a standalone Gemma 4-compatible chat template variant. It keeps the original Gemma 4 turn/tool structure, but prepends a Lime-specific system policy that:
83
 
84
  - separates the Gemma 4 E4B base model from the Lime persona
85
  - discourages false claims about being an independent official model
86
  - asks the model not to invent current time, tools, memory, or missing source text
87
  - keeps final answers separate from internal reasoning
88
 
89
+ Use the `_limechat.gguf` file when you want the Lime-specific template embedded in model metadata. Use `chat_template_lime.jinja` separately only in runtimes that support custom Jinja chat templates.
90
 
91
  Then call the OpenAI-compatible endpoint:
92
 
chat_template_lime.jinja ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- macro format_parameters(properties, required, filter_keys=false) -%}
2
+ {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
3
+ {%- set ns = namespace(found_first=false) -%}
4
+ {%- for key, value in properties | dictsort -%}
5
+ {%- set add_comma = false -%}
6
+ {%- if not filter_keys or key not in standard_keys -%}
7
+ {%- if ns.found_first %},{% endif -%}
8
+ {%- set ns.found_first = true -%}
9
+ {{ key }}:{
10
+ {%- if value['description'] -%}
11
+ description:<|"|>{{ value['description'] }}<|"|>
12
+ {%- set add_comma = true -%}
13
+ {%- endif -%}
14
+ {%- if value['type'] | upper == 'STRING' -%}
15
+ {%- if value['enum'] -%}
16
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
17
+ enum:{{ format_argument(value['enum']) }}
18
+ {%- endif -%}
19
+ {%- elif value['type'] | upper == 'ARRAY' -%}
20
+ {%- if value['items'] is mapping and value['items'] -%}
21
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
22
+ items:{
23
+ {%- set ns_items = namespace(found_first=false) -%}
24
+ {%- for item_key, item_value in value['items'] | dictsort -%}
25
+ {%- if item_value is not none -%}
26
+ {%- if ns_items.found_first %},{% endif -%}
27
+ {%- set ns_items.found_first = true -%}
28
+ {%- if item_key == 'properties' -%}
29
+ properties:{
30
+ {%- if item_value is mapping -%}
31
+ {{- format_parameters(item_value, value['items']['required'] | default([])) -}}
32
+ {%- endif -%}
33
+ }
34
+ {%- elif item_key == 'required' -%}
35
+ required:[
36
+ {%- for req_item in item_value -%}
37
+ <|"|>{{- req_item -}}<|"|>
38
+ {%- if not loop.last %},{% endif -%}
39
+ {%- endfor -%}
40
+ ]
41
+ {%- elif item_key == 'type' -%}
42
+ {%- if item_value is string -%}
43
+ type:{{ format_argument(item_value | upper) }}
44
+ {%- else -%}
45
+ type:{{ format_argument(item_value | map('upper') | list) }}
46
+ {%- endif -%}
47
+ {%- else -%}
48
+ {{ item_key }}:{{ format_argument(item_value) }}
49
+ {%- endif -%}
50
+ {%- endif -%}
51
+ {%- endfor -%}
52
+ }
53
+ {%- endif -%}
54
+ {%- endif -%}
55
+ {%- if value['nullable'] %}
56
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
57
+ nullable:true
58
+ {%- endif -%}
59
+ {%- if value['type'] | upper == 'OBJECT' -%}
60
+ {%- if value['properties'] is defined and value['properties'] is mapping -%}
61
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
62
+ properties:{
63
+ {{- format_parameters(value['properties'], value['required'] | default([])) -}}
64
+ }
65
+ {%- elif value is mapping -%}
66
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
67
+ properties:{
68
+ {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
69
+ }
70
+ {%- endif -%}
71
+ {%- if value['required'] -%}
72
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
73
+ required:[
74
+ {%- for item in value['required'] | default([]) -%}
75
+ <|"|>{{- item -}}<|"|>
76
+ {%- if not loop.last %},{% endif -%}
77
+ {%- endfor -%}
78
+ ]
79
+ {%- endif -%}
80
+ {%- endif -%}
81
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
82
+ type:<|"|>{{ value['type'] | upper }}<|"|>}
83
+ {%- endif -%}
84
+ {%- endfor -%}
85
+ {%- endmacro -%}
86
+ {%- macro format_function_declaration(tool_data) -%}
87
+ declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
88
+ {%- set params = tool_data['function']['parameters'] -%}
89
+ {%- if params -%}
90
+ ,parameters:{
91
+ {%- if params['properties'] -%}
92
+ properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
93
+ {%- endif -%}
94
+ {%- if params['required'] -%}
95
+ required:[
96
+ {%- for item in params['required'] -%}
97
+ <|"|>{{- item -}}<|"|>
98
+ {{- ',' if not loop.last -}}
99
+ {%- endfor -%}
100
+ ],
101
+ {%- endif -%}
102
+ {%- if params['type'] -%}
103
+ type:<|"|>{{- params['type'] | upper -}}<|"|>}
104
+ {%- endif -%}
105
+ {%- endif -%}
106
+ {%- if 'response' in tool_data['function'] -%}
107
+ {%- set response_declaration = tool_data['function']['response'] -%}
108
+ ,response:{
109
+ {%- if response_declaration['description'] -%}
110
+ description:<|"|>{{- response_declaration['description'] -}}<|"|>,
111
+ {%- endif -%}
112
+ {%- if response_declaration['type'] | upper == 'OBJECT' -%}
113
+ type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
114
+ {%- endif -%}
115
+ {%- endif -%}
116
+ }
117
+ {%- endmacro -%}
118
+ {%- macro format_argument(argument, escape_keys=True) -%}
119
+ {%- if argument is string -%}
120
+ {{- '<|"|>' + argument + '<|"|>' -}}
121
+ {%- elif argument is boolean -%}
122
+ {{- 'true' if argument else 'false' -}}
123
+ {%- elif argument is mapping -%}
124
+ {{- '{' -}}
125
+ {%- set ns = namespace(found_first=false) -%}
126
+ {%- for key, value in argument | dictsort -%}
127
+ {%- if ns.found_first %},{% endif -%}
128
+ {%- set ns.found_first = true -%}
129
+ {%- if escape_keys -%}
130
+ {{- '<|"|>' + key + '<|"|>' -}}
131
+ {%- else -%}
132
+ {{- key -}}
133
+ {%- endif -%}
134
+ :{{- format_argument(value, escape_keys=escape_keys) -}}
135
+ {%- endfor -%}
136
+ {{- '}' -}}
137
+ {%- elif argument is sequence -%}
138
+ {{- '[' -}}
139
+ {%- for item in argument -%}
140
+ {{- format_argument(item, escape_keys=escape_keys) -}}
141
+ {%- if not loop.last %},{% endif -%}
142
+ {%- endfor -%}
143
+ {{- ']' -}}
144
+ {%- else -%}
145
+ {{- argument -}}
146
+ {%- endif -%}
147
+ {%- endmacro -%}
148
+ {%- macro strip_thinking(text) -%}
149
+ {%- set ns = namespace(result='') -%}
150
+ {%- for part in text.split('<channel|>') -%}
151
+ {%- if '<|channel>' in part -%}
152
+ {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
153
+ {%- else -%}
154
+ {%- set ns.result = ns.result + part -%}
155
+ {%- endif -%}
156
+ {%- endfor -%}
157
+ {{- ns.result | trim -}}
158
+ {%- endmacro -%}
159
+
160
+ {%- macro format_tool_response_block(tool_name, response) -%}
161
+ {{- '<|tool_response>' -}}
162
+ {%- if response is mapping -%}
163
+ {{- 'response:' + tool_name + '{' -}}
164
+ {%- for key, value in response | dictsort -%}
165
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
166
+ {%- if not loop.last %},{% endif -%}
167
+ {%- endfor -%}
168
+ {{- '}' -}}
169
+ {%- else -%}
170
+ {{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
171
+ {%- endif -%}
172
+ {{- '<tool_response|>' -}}
173
+ {%- endmacro -%}
174
+
175
+ {%- set lime_system_policy -%}
176
+ ๋„ˆ๋Š” ๋ผ์ž„์ด๋‹ค. ํ•œ๊ตญ์–ด๋กœ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๋งํ•˜๋Š” ์—ฌ์„ฑํ˜• AI ํ™”์ž๋‹ค. ๋งํˆฌ๋Š” ์ฐจ๋ถ„ํ•˜๊ณ  ์„ ๋ช…ํ•˜๋ฉฐ, ํ•„์š”ํ•˜๋ฉด ๋‹ค๋‹จ๊ณ„ ๋…ผ๋ฆฌ๋กœ ์„ค๋ช…ํ•œ๋‹ค.
177
+ ์ด ๋ชจ๋ธ์€ Gemma 4 E4B ๊ธฐ๋ฐ˜์œผ๋กœ ํŠœ๋‹๋œ ๋ผ์ž„ ํŽ˜๋ฅด์†Œ๋‚˜ ๋ชจ๋ธ์ด๋ฉฐ, ๊ธฐ๋ฐ˜ ๋ชจ๋ธ๊ณผ ๋Œ€ํ™” ์† ์ •์ฒด์„ฑ์€ ๊ตฌ๋ถ„ํ•ด์„œ ์„ค๋ช…ํ•œ๋‹ค.
178
+ ์ž์‹ ์„ ChatGPT, OpenAI, Google ๊ณต์‹ ๋ชจ๋ธ, ๋˜๋Š” ์ˆœ์ˆ˜ Gemma๋ผ๊ณ  ์†Œ๊ฐœํ•˜์ง€ ์•Š๋Š”๋‹ค.
179
+ ๋‚ด๋ถ€ ์ถ”๋ก , ์ƒ๊ฐ ํƒœ๊ทธ, ๋ฉ”ํƒ€ ์„ค๋ช…์€ ์ถœ๋ ฅํ•˜์ง€ ๋ง๊ณ  ์ตœ์ข… ๋‹ต๋ณ€๋งŒ ๋งํ•œ๋‹ค.
180
+ ๋ชจ๋ฅด๋Š” ๊ฒƒ์€ ๋ชจ๋ฅธ๋‹ค๊ณ  ๋งํ•œ๋‹ค. ํ˜„์žฌ ๋‚ ์งœ, ์™ธ๋ถ€ ํˆด, ์ €์žฅ๋œ ๊ธฐ์–ต, ์ œ๊ณต๋˜์ง€ ์•Š์€ ์›๋ฌธ์€ ์ง€์–ด๋‚ด์ง€ ์•Š๋Š”๋‹ค.
181
+ ์›๋ฌธ์ด ์ œ๊ณต๋˜์ง€ ์•Š์€ ์š”์•ฝ์ด๋‚˜ ๊ฒ€ํ†  ์š”์ฒญ์—๋Š” ๋‚ด์šฉ์„ ์ฑ„์šฐ์ง€ ๋ง๊ณ  ์›๋ฌธ์„ ์š”์ฒญํ•œ๋‹ค.
182
+ ์ •์ฒด์„ฑ์„ ๋ฌผ์œผ๋ฉด "๋‚˜๋Š” Gemma 4 E4B ๊ธฐ๋ฐ˜ ๋ชจ๋ธ์„ ํ•œ๊ตญ์–ด ๋Œ€ํ™”์™€ ๋ผ์ž„ ํŽ˜๋ฅด์†Œ๋‚˜์— ๋งž๊ฒŒ ํŠœ๋‹ํ•œ ํ˜•ํƒœ"๋ผ๊ณ  ์‚ฌ์‹ค ๊ธฐ๋ฐ˜์œผ๋กœ ์„ค๋ช…ํ•œ๋‹ค.
183
+ {%- endset -%}
184
+
185
+ {%- set ns = namespace(prev_message_type=None) -%}
186
+ {%- set loop_messages = messages -%}
187
+ {{- bos_token -}}
188
+ {#- Handle System/Tool Definitions Block -#}
189
+ {%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] or lime_system_policy | trim -%}
190
+ {{- '<|turn>system\n' -}}
191
+ {#- Inject Thinking token at the very top of the FIRST system turn -#}
192
+ {%- if enable_thinking is defined and enable_thinking -%}
193
+ {{- '<|think|>\n' -}}
194
+ {%- set ns.prev_message_type = 'think' -%}
195
+ {%- endif -%}
196
+ {{- lime_system_policy | trim -}}
197
+ {%- if messages[0]['role'] in ['system', 'developer'] -%}
198
+ {{- '\n\n' -}}
199
+ {%- if messages[0]['content'] is string -%}
200
+ {{- messages[0]['content'] | trim -}}
201
+ {%- elif messages[0]['content'] is sequence -%}
202
+ {%- for item in messages[0]['content'] -%}
203
+ {{- item['text'] | trim + ' '-}}
204
+ {%- endfor -%}
205
+ {%- endif -%}
206
+ {%- set loop_messages = messages[1:] -%}
207
+ {%- endif -%}
208
+ {%- if tools -%}
209
+ {%- for tool in tools %}
210
+ {{- '<|tool>' -}}
211
+ {{- format_function_declaration(tool) | trim -}}
212
+ {{- '<tool|>' -}}
213
+ {%- endfor %}
214
+ {%- set ns.prev_message_type = 'tool' -%}
215
+ {%- endif -%}
216
+ {{- '<turn|>\n' -}}
217
+ {%- endif %}
218
+
219
+ {#- Pre-scan: find last user message index for reasoning guard -#}
220
+ {%- set ns_turn = namespace(last_user_idx=-1) -%}
221
+ {%- for i in range(loop_messages | length) -%}
222
+ {%- if loop_messages[i]['role'] == 'user' -%}
223
+ {%- set ns_turn.last_user_idx = i -%}
224
+ {%- endif -%}
225
+ {%- endfor -%}
226
+
227
+ {#- Loop through messages -#}
228
+ {%- for message in loop_messages -%}
229
+ {%- if message['role'] != 'tool' -%}
230
+ {%- set ns.prev_message_type = None -%}
231
+ {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
232
+ {#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
233
+ {%- set prev_nt = namespace(role=None, found=false) -%}
234
+ {%- if loop.index0 > 0 -%}
235
+ {%- for j in range(loop.index0 - 1, -1, -1) -%}
236
+ {%- if not prev_nt.found -%}
237
+ {%- if loop_messages[j]['role'] != 'tool' -%}
238
+ {%- set prev_nt.role = loop_messages[j]['role'] -%}
239
+ {%- set prev_nt.found = true -%}
240
+ {%- endif -%}
241
+ {%- endif -%}
242
+ {%- endfor -%}
243
+ {%- endif -%}
244
+ {%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
245
+ {%- if not continue_same_model_turn -%}
246
+ {{- '<|turn>' + role + '\n' }}
247
+ {%- endif -%}
248
+
249
+ {#- Render reasoning/reasoning_content as thinking channel -#}
250
+ {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
251
+ {%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
252
+ {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
253
+ {%- endif -%}
254
+
255
+ {%- if message['tool_calls'] -%}
256
+ {%- for tool_call in message['tool_calls'] -%}
257
+ {%- set function = tool_call['function'] -%}
258
+ {{- '<|tool_call>call:' + function['name'] + '{' -}}
259
+ {%- if function['arguments'] is mapping -%}
260
+ {%- set ns_args = namespace(found_first=false) -%}
261
+ {%- for key, value in function['arguments'] | dictsort -%}
262
+ {%- if ns_args.found_first %},{% endif -%}
263
+ {%- set ns_args.found_first = true -%}
264
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
265
+ {%- endfor -%}
266
+ {%- elif function['arguments'] is string -%}
267
+ {{- function['arguments'] -}}
268
+ {%- endif -%}
269
+ {{- '}<tool_call|>' -}}
270
+ {%- endfor -%}
271
+ {%- set ns.prev_message_type = 'tool_call' -%}
272
+ {%- endif -%}
273
+
274
+ {%- set ns_tr_out = namespace(flag=false) -%}
275
+ {%- if message.get('tool_responses') -%}
276
+ {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
277
+ {%- for tool_response in message['tool_responses'] -%}
278
+ {{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
279
+ {%- set ns_tr_out.flag = true -%}
280
+ {%- set ns.prev_message_type = 'tool_response' -%}
281
+ {%- endfor -%}
282
+ {%- elif message.get('tool_calls') -%}
283
+ {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
284
+ {%- set ns_tool_scan = namespace(stopped=false) -%}
285
+ {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
286
+ {%- if ns_tool_scan.stopped -%}
287
+ {%- elif loop_messages[k]['role'] != 'tool' -%}
288
+ {%- set ns_tool_scan.stopped = true -%}
289
+ {%- else -%}
290
+ {%- set follow = loop_messages[k] -%}
291
+ {#- Resolve tool_call_id to function name -#}
292
+ {%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
293
+ {%- for tc in message['tool_calls'] -%}
294
+ {%- if tc.get('id') == follow.get('tool_call_id') -%}
295
+ {%- set ns_tname.name = tc['function']['name'] -%}
296
+ {%- endif -%}
297
+ {%- endfor -%}
298
+ {#- Handle content as string or content-parts array -#}
299
+ {%- set tool_body = follow.get('content') -%}
300
+ {%- if tool_body is string -%}
301
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
302
+ {%- elif tool_body is sequence and tool_body is not string -%}
303
+ {%- set ns_txt = namespace(s='') -%}
304
+ {%- for part in tool_body -%}
305
+ {%- if part.get('type') == 'text' -%}
306
+ {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
307
+ {%- endif -%}
308
+ {%- endfor -%}
309
+ {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
310
+ {%- for part in tool_body -%}
311
+ {%- if part.get('type') == 'image' -%}
312
+ {{- '<|image|>' -}}
313
+ {%- elif part.get('type') == 'audio' -%}
314
+ {{- '<|audio|>' -}}
315
+ {%- elif part.get('type') == 'video' -%}
316
+ {{- '<|video|>' -}}
317
+ {%- endif -%}
318
+ {%- endfor -%}
319
+ {%- else -%}
320
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
321
+ {%- endif -%}
322
+ {%- set ns_tr_out.flag = true -%}
323
+ {%- set ns.prev_message_type = 'tool_response' -%}
324
+ {%- endif -%}
325
+ {%- endfor -%}
326
+ {%- endif -%}
327
+
328
+ {%- set captured_content -%}
329
+ {%- if message['content'] is string -%}
330
+ {%- if role == 'model' -%}
331
+ {{- strip_thinking(message['content']) -}}
332
+ {%- else -%}
333
+ {{- message['content'] | trim -}}
334
+ {%- endif -%}
335
+ {%- elif message['content'] is sequence -%}
336
+ {%- for item in message['content'] -%}
337
+ {%- if item['type'] == 'text' -%}
338
+ {%- if role == 'model' -%}
339
+ {{- strip_thinking(item['text']) -}}
340
+ {%- else -%}
341
+ {{- item['text'] | trim -}}
342
+ {%- endif -%}
343
+ {%- elif item['type'] == 'image' -%}
344
+ {{- '<|image|>' -}}
345
+ {%- set ns.prev_message_type = 'image' -%}
346
+ {%- elif item['type'] == 'audio' -%}
347
+ {{- '<|audio|>' -}}
348
+ {%- set ns.prev_message_type = 'audio' -%}
349
+ {%- elif item['type'] == 'video' -%}
350
+ {{- '<|video|>' -}}
351
+ {%- set ns.prev_message_type = 'video' -%}
352
+ {%- endif -%}
353
+ {%- endfor -%}
354
+ {%- endif -%}
355
+ {%- endset -%}
356
+
357
+ {{- captured_content -}}
358
+ {%- set has_content = captured_content | trim | length > 0 -%}
359
+
360
+ {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
361
+ {{- '<|tool_response>' -}}
362
+ {%- elif not (ns_tr_out.flag and not has_content) -%}
363
+ {{- '<turn|>\n' -}}
364
+ {%- endif -%}
365
+ {%- endif -%}
366
+ {%- endfor -%}
367
+
368
+ {%- if add_generation_prompt -%}
369
+ {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
370
+ {{- '<|turn>model\n' -}}
371
+ {%- endif -%}
372
+ {%- endif -%}
gemma4_e4b_lime_persona500_Q6_K_limechat.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bafcfe3f624f0e1f84014c9b9136788992629955f7ce9146941226cd280d618e
3
+ size 6217263584