fastpixels commited on
Commit
8f9e4b6
·
verified ·
1 Parent(s): 1f1af2a

E12: surgered Gemma-4-E4B-it, text only, 161,405 tokens (8,000 new Odia), before training

Browse files
gemma4-e4b-odia8k/base/chat_template.jinja ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#
2
+ Template: Google Gemma 4 Canonical Chat Template
3
+ Author: Google Gemma Engineering Team
4
+ Published: 2026-07-09
5
+ Context: Fixed tool-calling loops, turn closures, and thinking content-ordering.
6
+ #}
7
+ {%- macro format_parameters(properties, required, filter_keys=false) -%}
8
+ {%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
9
+ {%- set ns = namespace(found_first=false) -%}
10
+ {%- for key, value in properties | dictsort -%}
11
+ {%- set add_comma = false -%}
12
+ {%- if not filter_keys or key not in standard_keys -%}
13
+ {%- if ns.found_first %},{% endif -%}
14
+ {%- set ns.found_first = true -%}
15
+ {{ key }}:{
16
+ {%- if value['description'] -%}
17
+ description:<|"|>{{ value['description'] }}<|"|>
18
+ {%- set add_comma = true -%}
19
+ {%- endif -%}
20
+ {%- if value['type'] | upper == 'STRING' -%}
21
+ {%- if value['enum'] -%}
22
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
23
+ enum:{{ format_argument(value['enum']) }}
24
+ {%- endif -%}
25
+ {%- elif value['type'] | upper == 'ARRAY' -%}
26
+ {%- if value['items'] is mapping and value['items'] -%}
27
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
28
+ items:{
29
+ {%- set ns_items = namespace(found_first=false) -%}
30
+ {%- for item_key, item_value in value['items'] | dictsort -%}
31
+ {%- if item_value is not none -%}
32
+ {%- if ns_items.found_first %},{% endif -%}
33
+ {%- set ns_items.found_first = true -%}
34
+ {%- if item_key == 'properties' -%}
35
+ properties:{
36
+ {%- if item_value is mapping -%}
37
+ {{- format_parameters(item_value, value['items']['required'] | default([])) -}}
38
+ {%- endif -%}
39
+ }
40
+ {%- elif item_key == 'required' -%}
41
+ required:[
42
+ {%- for req_item in item_value -%}
43
+ <|"|>{{- req_item -}}<|"|>
44
+ {%- if not loop.last %},{% endif -%}
45
+ {%- endfor -%}
46
+ ]
47
+ {%- elif item_key == 'type' -%}
48
+ {%- if item_value is string -%}
49
+ type:{{ format_argument(item_value | upper) }}
50
+ {%- else -%}
51
+ type:{{ format_argument(item_value | map('upper') | list) }}
52
+ {%- endif -%}
53
+ {%- else -%}
54
+ {{ item_key }}:{{ format_argument(item_value) }}
55
+ {%- endif -%}
56
+ {%- endif -%}
57
+ {%- endfor -%}
58
+ }
59
+ {%- endif -%}
60
+ {%- endif -%}
61
+ {%- if value['nullable'] %}
62
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
63
+ nullable:true
64
+ {%- endif -%}
65
+ {%- if value['type'] | upper == 'OBJECT' -%}
66
+ {%- if value['properties'] is defined and value['properties'] is mapping -%}
67
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
68
+ properties:{
69
+ {{- format_parameters(value['properties'], value['required'] | default([])) -}}
70
+ }
71
+ {%- elif value is mapping -%}
72
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
73
+ properties:{
74
+ {{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
75
+ }
76
+ {%- endif -%}
77
+ {%- if value['required'] -%}
78
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
79
+ required:[
80
+ {%- for item in value['required'] | default([]) -%}
81
+ <|"|>{{- item -}}<|"|>
82
+ {%- if not loop.last %},{% endif -%}
83
+ {%- endfor -%}
84
+ ]
85
+ {%- endif -%}
86
+ {%- endif -%}
87
+ {%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
88
+ type:<|"|>{{ value['type'] | upper }}<|"|>}
89
+ {%- endif -%}
90
+ {%- endfor -%}
91
+ {%- endmacro -%}
92
+ {%- macro format_function_declaration(tool_data) -%}
93
+ declaration:{{- tool_data['function']['name'] -}}{description:<|"|>{{- tool_data['function']['description'] -}}<|"|>
94
+ {%- set params = tool_data['function']['parameters'] -%}
95
+ {%- if params -%}
96
+ ,parameters:{
97
+ {%- if params['properties'] -%}
98
+ properties:{ {{- format_parameters(params['properties'], params['required']) -}} },
99
+ {%- endif -%}
100
+ {%- if params['required'] -%}
101
+ required:[
102
+ {%- for item in params['required'] -%}
103
+ <|"|>{{- item -}}<|"|>
104
+ {{- ',' if not loop.last -}}
105
+ {%- endfor -%}
106
+ ],
107
+ {%- endif -%}
108
+ {%- if params['type'] -%}
109
+ type:<|"|>{{- params['type'] | upper -}}<|"|>}
110
+ {%- endif -%}
111
+ {%- endif -%}
112
+ {%- if 'response' in tool_data['function'] -%}
113
+ {%- set response_declaration = tool_data['function']['response'] -%}
114
+ ,response:{
115
+ {%- if response_declaration['description'] -%}
116
+ description:<|"|>{{- response_declaration['description'] -}}<|"|>,
117
+ {%- endif -%}
118
+ {%- if response_declaration['type'] | upper == 'OBJECT' -%}
119
+ type:<|"|>{{- response_declaration['type'] | upper -}}<|"|>}
120
+ {%- endif -%}
121
+ {%- endif -%}
122
+ }
123
+ {%- endmacro -%}
124
+ {%- macro format_argument(argument, escape_keys=True) -%}
125
+ {%- if argument is none -%}
126
+ {{- 'null' -}}
127
+ {%- elif argument is string -%}
128
+ {{- '<|"|>' + argument + '<|"|>' -}}
129
+ {%- elif argument is boolean -%}
130
+ {{- 'true' if argument else 'false' -}}
131
+ {%- elif argument is mapping -%}
132
+ {{- '{' -}}
133
+ {%- set ns = namespace(found_first=false) -%}
134
+ {%- for key, value in argument | dictsort -%}
135
+ {%- if ns.found_first %},{% endif -%}
136
+ {%- set ns.found_first = true -%}
137
+ {%- if escape_keys -%}
138
+ {{- '<|"|>' + key + '<|"|>' -}}
139
+ {%- else -%}
140
+ {{- key -}}
141
+ {%- endif -%}
142
+ :{{- format_argument(value, escape_keys=escape_keys) -}}
143
+ {%- endfor -%}
144
+ {{- '}' -}}
145
+ {%- elif argument is sequence -%}
146
+ {{- '[' -}}
147
+ {%- for item in argument -%}
148
+ {{- format_argument(item, escape_keys=escape_keys) -}}
149
+ {%- if not loop.last %},{% endif -%}
150
+ {%- endfor -%}
151
+ {{- ']' -}}
152
+ {%- else -%}
153
+ {{- argument -}}
154
+ {%- endif -%}
155
+ {%- endmacro -%}
156
+ {%- macro strip_thinking(text) -%}
157
+ {%- set ns = namespace(result='') -%}
158
+ {%- for part in text.split('<channel|>') -%}
159
+ {%- if '<|channel>' in part -%}
160
+ {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
161
+ {%- else -%}
162
+ {%- set ns.result = ns.result + part -%}
163
+ {%- endif -%}
164
+ {%- endfor -%}
165
+ {{- ns.result | trim -}}
166
+ {%- endmacro -%}
167
+
168
+ {%- macro format_tool_response_block(tool_name, response) -%}
169
+ {{- '<|tool_response>' -}}
170
+ {%- if response is mapping -%}
171
+ {{- 'response:' + tool_name + '{' -}}
172
+ {%- for key, value in response | dictsort -%}
173
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
174
+ {%- if not loop.last %},{% endif -%}
175
+ {%- endfor -%}
176
+ {{- '}' -}}
177
+ {%- else -%}
178
+ {{- 'response:' + tool_name + '{value:' + format_argument(response, escape_keys=False) + '}' -}}
179
+ {%- endif -%}
180
+ {{- '<tool_response|>' -}}
181
+ {%- endmacro -%}
182
+
183
+ {#- ===== SETUP ===== -#}
184
+ {%- set ns = namespace(prev_message_type=None, prev_non_tool_role=None) -%}
185
+ {%- set loop_messages = messages -%}
186
+ {%- set enable_thinking = enable_thinking | default(false) -%}
187
+ {%- set preserve_thinking = preserve_thinking | default(false) -%}
188
+ {{- bos_token -}}
189
+ {#- Handle System/Tool Definitions Block -#}
190
+ {%- if enable_thinking or tools or (messages and messages[0]['role'] in ['system', 'developer']) -%}
191
+ {{- '<|turn>system\n' -}}
192
+ {#- Inject Thinking token at the very top of the FIRST system turn -#}
193
+ {%- if enable_thinking -%}
194
+ {{- '<|think|>\n' -}}
195
+ {%- set ns.prev_message_type = 'think' -%}
196
+ {%- endif -%}
197
+ {%- if messages and messages[0]['role'] in ['system', 'developer'] -%}
198
+ {%- if messages[0]['content'] is string -%}
199
+ {{- messages[0]['content'] | trim -}}
200
+ {%- elif messages[0]['content'] is sequence -%}
201
+ {%- for item in messages[0]['content'] -%}
202
+ {{- item['text'] | trim + ' '-}}
203
+ {%- endfor -%}
204
+ {%- endif -%}
205
+ {%- set loop_messages = messages[1:] -%}
206
+ {%- endif -%}
207
+ {%- if tools -%}
208
+ {%- for tool in tools %}
209
+ {{- '<|tool>' -}}
210
+ {{- format_function_declaration(tool) | trim -}}
211
+ {{- '<tool|>' -}}
212
+ {%- endfor %}
213
+ {%- set ns.prev_message_type = 'tool' -%}
214
+ {%- endif -%}
215
+ {{- '<turn|>\n' -}}
216
+ {%- endif %}
217
+
218
+ {#- Pre-scan: find last user message index for reasoning guard -#}
219
+ {%- set ns_turn = namespace(last_user_idx=-1) -%}
220
+ {%- for i in range(loop_messages | length) -%}
221
+ {%- if loop_messages[i]['role'] == 'user' -%}
222
+ {%- set ns_turn.last_user_idx = i -%}
223
+ {%- endif -%}
224
+ {%- endfor -%}
225
+
226
+ {#- Loop through messages -#}
227
+ {%- for message in loop_messages -%}
228
+ {%- if message['role'] != 'tool' -%}
229
+ {%- set ns.prev_message_type = None -%}
230
+ {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
231
+ {#- Detect continuation using tracked state — O(1) instead of O(n) backward scan -#}
232
+ {%- set continue_same_model_turn = (role == 'model' and ns.prev_non_tool_role == 'assistant') -%}
233
+ {%- if not continue_same_model_turn -%}
234
+ {{- '<|turn>' + role + '\n' }}
235
+ {%- endif -%}
236
+
237
+ {#- Render reasoning/reasoning_content as thinking channel -#}
238
+ {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
239
+ {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or (preserve_thinking and message.get('tool_calls')) -%}
240
+ {%- if thinking_text and thinking_gate -%}
241
+ {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
242
+ {%- endif -%}
243
+
244
+ {%- if message.get('tool_calls') -%}
245
+ {%- for tool_call in message.get('tool_calls') -%}
246
+ {%- set function = tool_call['function'] -%}
247
+ {{- '<|tool_call>call:' + function['name'] + '{' -}}
248
+ {%- if function['arguments'] is mapping -%}
249
+ {%- set ns_args = namespace(found_first=false) -%}
250
+ {%- for key, value in function['arguments'] | dictsort -%}
251
+ {%- if ns_args.found_first %},{% endif -%}
252
+ {%- set ns_args.found_first = true -%}
253
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
254
+ {%- endfor -%}
255
+ {%- elif function['arguments'] is none -%}
256
+ {%- else -%}
257
+ {{- raise_exception(
258
+ "chat_template: tool_calls[].function.arguments must be a "
259
+ "JSON object (mapping), not a string. Deserialize arguments "
260
+ "before passing to the template."
261
+ ) -}}
262
+ {%- endif -%}
263
+ {{- '}<tool_call|>' -}}
264
+ {%- endfor -%}
265
+ {%- set ns.prev_message_type = 'tool_call' -%}
266
+ {%- endif -%}
267
+
268
+ {%- set ns_tr_out = namespace(flag=false) -%}
269
+ {%- if message.get('tool_responses') -%}
270
+ {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
271
+ {%- for tool_response in message.get('tool_responses') -%}
272
+ {{- format_tool_response_block(tool_response['name'] | default('unknown', true), tool_response['response']) -}}
273
+ {%- set ns_tr_out.flag = true -%}
274
+ {%- set ns.prev_message_type = 'tool_response' -%}
275
+ {%- endfor -%}
276
+ {%- elif message.get('tool_calls') -%}
277
+ {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
278
+ {%- set ns_tool_scan = namespace(stopped=false) -%}
279
+ {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
280
+ {%- if ns_tool_scan.stopped -%}
281
+ {%- elif loop_messages[k]['role'] != 'tool' -%}
282
+ {%- set ns_tool_scan.stopped = true -%}
283
+ {%- else -%}
284
+ {%- set follow = loop_messages[k] -%}
285
+ {#- Resolve tool_call_id to function name -#}
286
+ {%- set ns_tname = namespace(name=follow.get('name') or 'unknown') -%}
287
+ {%- for tc in message.get('tool_calls') -%}
288
+ {%- if tc.get('id') == follow.get('tool_call_id') -%}
289
+ {%- set ns_tname.name = tc['function']['name'] -%}
290
+ {%- endif -%}
291
+ {%- endfor -%}
292
+ {#- Handle content as string or content-parts array -#}
293
+ {%- set tool_body = follow.get('content') -%}
294
+ {%- if tool_body is string -%}
295
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
296
+ {%- elif tool_body is sequence and tool_body is not string -%}
297
+ {%- set ns_txt = namespace(s='') -%}
298
+ {%- for part in tool_body -%}
299
+ {%- if part.get('type') == 'text' -%}
300
+ {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
301
+ {%- endif -%}
302
+ {%- endfor -%}
303
+ {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
304
+ {%- for part in tool_body -%}
305
+ {%- if part.get('type') in ['image', 'image_url'] -%}
306
+ {{- '<|image|>' -}}
307
+ {%- elif part.get('type') in ['audio', 'input_audio'] -%}
308
+ {{- '<|audio|>' -}}
309
+ {%- elif part.get('type') == 'video' -%}
310
+ {{- '<|video|>' -}}
311
+ {%- endif -%}
312
+ {%- endfor -%}
313
+ {%- else -%}
314
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
315
+ {%- endif -%}
316
+ {%- set ns_tr_out.flag = true -%}
317
+ {%- set ns.prev_message_type = 'tool_response' -%}
318
+ {%- endif -%}
319
+ {%- endfor -%}
320
+ {%- endif -%}
321
+
322
+ {%- set captured_content -%}
323
+ {%- if message.get('content') is string -%}
324
+ {%- if role == 'model' -%}
325
+ {{- strip_thinking(message['content']) -}}
326
+ {%- else -%}
327
+ {{- message['content'] | trim -}}
328
+ {%- endif -%}
329
+ {%- elif message.get('content') is sequence -%}
330
+ {%- for item in message['content'] -%}
331
+ {%- if item.get('type') == 'text' -%}
332
+ {%- if role == 'model' -%}
333
+ {{- strip_thinking(item['text']) -}}
334
+ {%- else -%}
335
+ {{- item['text'] | trim -}}
336
+ {%- endif -%}
337
+ {%- elif item.get('type') in ['image', 'image_url'] -%}
338
+ {{- '<|image|>' -}}
339
+ {%- elif item.get('type') in ['audio', 'input_audio'] -%}
340
+ {{- '<|audio|>' -}}
341
+ {%- elif item.get('type') == 'video' -%}
342
+ {{- '<|video|>' -}}
343
+ {%- endif -%}
344
+ {%- endfor -%}
345
+ {%- endif -%}
346
+ {%- endset -%}
347
+
348
+ {{- captured_content -}}
349
+ {%- set has_content = captured_content | trim | length > 0 -%}
350
+
351
+ {#- Forward-scan: find next non-tool message role for continuation detection -#}
352
+ {%- set next_nt = namespace(role=None, found=false) -%}
353
+ {%- for j in range(loop.index0 + 1, loop_messages | length) -%}
354
+ {%- if not next_nt.found -%}
355
+ {%- if loop_messages[j]['role'] != 'tool' -%}
356
+ {%- set next_nt.role = loop_messages[j]['role'] -%}
357
+ {%- set next_nt.found = true -%}
358
+ {%- endif -%}
359
+ {%- endif -%}
360
+ {%- endfor -%}
361
+
362
+ {%- set continues_into_next = (
363
+ role == 'model'
364
+ and next_nt.role == 'assistant'
365
+ and (not message.get('tool_calls') or ns_tr_out.flag)
366
+ ) -%}
367
+
368
+ {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
369
+ {{- '<|tool_response>' -}}
370
+ {%- elif continues_into_next -%}
371
+ {%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
372
+ {{- '<turn|>\n' -}}
373
+ {%- endif -%}
374
+
375
+ {#- Track previous non-tool role for next iteration (avoids O(n) backward scan) -#}
376
+ {%- set ns.prev_non_tool_role = message['role'] -%}
377
+ {%- endif -%}
378
+ {%- endfor -%}
379
+
380
+ {%- if add_generation_prompt -%}
381
+ {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
382
+ {{- '<|turn>model\n' -}}
383
+ {%- elif ns.prev_message_type == 'tool_response' and enable_thinking -%}
384
+ {{- '<|channel>thought\n' -}}
385
+ {%- endif -%}
386
+ {%- endif -%}
gemma4-e4b-odia8k/base/config.json ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "attention_bias": false,
3
+ "attention_dropout": 0.0,
4
+ "attention_k_eq_v": false,
5
+ "bos_token_id": 2,
6
+ "dtype": "bfloat16",
7
+ "enable_moe_block": false,
8
+ "eos_token_id": 1,
9
+ "expert_intermediate_size": null,
10
+ "final_logit_softcapping": 30.0,
11
+ "global_head_dim": 512,
12
+ "head_dim": 256,
13
+ "hidden_activation": "gelu_pytorch_tanh",
14
+ "hidden_size": 2560,
15
+ "hidden_size_per_layer_input": 256,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 10240,
18
+ "layer_types": [
19
+ "sliding_attention",
20
+ "sliding_attention",
21
+ "sliding_attention",
22
+ "sliding_attention",
23
+ "sliding_attention",
24
+ "full_attention",
25
+ "sliding_attention",
26
+ "sliding_attention",
27
+ "sliding_attention",
28
+ "sliding_attention",
29
+ "sliding_attention",
30
+ "full_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "sliding_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "sliding_attention",
40
+ "sliding_attention",
41
+ "sliding_attention",
42
+ "full_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "sliding_attention",
46
+ "sliding_attention",
47
+ "sliding_attention",
48
+ "full_attention",
49
+ "sliding_attention",
50
+ "sliding_attention",
51
+ "sliding_attention",
52
+ "sliding_attention",
53
+ "sliding_attention",
54
+ "full_attention",
55
+ "sliding_attention",
56
+ "sliding_attention",
57
+ "sliding_attention",
58
+ "sliding_attention",
59
+ "sliding_attention",
60
+ "full_attention"
61
+ ],
62
+ "max_position_embeddings": 131072,
63
+ "model_type": "gemma4_text",
64
+ "num_attention_heads": 8,
65
+ "num_experts": null,
66
+ "num_global_key_value_heads": null,
67
+ "num_hidden_layers": 42,
68
+ "num_key_value_heads": 2,
69
+ "num_kv_shared_layers": 18,
70
+ "pad_token_id": 0,
71
+ "rms_norm_eps": 1e-06,
72
+ "rope_parameters": {
73
+ "full_attention": {
74
+ "partial_rotary_factor": 0.25,
75
+ "rope_theta": 1000000.0,
76
+ "rope_type": "proportional"
77
+ },
78
+ "sliding_attention": {
79
+ "rope_theta": 10000.0,
80
+ "rope_type": "default"
81
+ }
82
+ },
83
+ "sliding_window": 512,
84
+ "tie_word_embeddings": true,
85
+ "top_k_experts": null,
86
+ "use_bidirectional_attention": null,
87
+ "use_cache": true,
88
+ "use_double_wide_mlp": false,
89
+ "vocab_size": 161405,
90
+ "vocab_size_per_layer_input": 161405,
91
+ "architectures": [
92
+ "Gemma4ForCausalLM"
93
+ ],
94
+ "transformers_version": "5.5.0.dev0"
95
+ }
gemma4-e4b-odia8k/base/generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 1,
6
+ 17,
7
+ 10
8
+ ],
9
+ "pad_token_id": 0,
10
+ "temperature": 1.0,
11
+ "top_k": 64,
12
+ "top_p": 0.95,
13
+ "transformers_version": "5.5.0.dev0"
14
+ }
gemma4-e4b-odia8k/base/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e04eae34be80f9eb9affd7d0040ec64d4baa61ebeebfa765427211e155b1c04a
3
+ size 12354146972
gemma4-e4b-odia8k/base/odia_merges.json ADDED
The diff for this file is too large to render. See raw diff
 
gemma4-e4b-odia8k/base/old_to_new_ids.json ADDED
The diff for this file is too large to render. See raw diff
 
gemma4-e4b-odia8k/base/surgery_report.json ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "stock": "/root/e12/stock",
3
+ "new_tokens_requested": 8000,
4
+ "hindi_share": 0.25,
5
+ "vocab_stock": 262144,
6
+ "vocab_kept": 161405,
7
+ "kept_stock": 153405,
8
+ "kept_new": 8000,
9
+ "closure_added": 1224,
10
+ "kinds": {
11
+ "byte": {
12
+ "kept": 256,
13
+ "dropped": 0
14
+ },
15
+ "english": {
16
+ "kept": 146916,
17
+ "dropped": 0
18
+ },
19
+ "hindi": {
20
+ "kept": 3532,
21
+ "dropped": 10146
22
+ },
23
+ "letter": {
24
+ "kept": 872,
25
+ "dropped": 0
26
+ },
27
+ "math": {
28
+ "kept": 422,
29
+ "dropped": 0
30
+ },
31
+ "multimodal": {
32
+ "kept": 0,
33
+ "dropped": 7
34
+ },
35
+ "odia": {
36
+ "kept": 134,
37
+ "dropped": 0
38
+ },
39
+ "other": {
40
+ "kept": 0,
41
+ "dropped": 93583
42
+ },
43
+ "special": {
44
+ "kept": 17,
45
+ "dropped": 0
46
+ },
47
+ "symbol": {
48
+ "kept": 32,
49
+ "dropped": 0
50
+ },
51
+ "unused": {
52
+ "kept": 0,
53
+ "dropped": 6227
54
+ }
55
+ },
56
+ "merges_stock": 514906,
57
+ "merges_kept": 386896,
58
+ "dropped_modules": [
59
+ "audio_tower",
60
+ "embed_audio",
61
+ "embed_vision",
62
+ "vision_tower"
63
+ ],
64
+ "params": 6177031466,
65
+ "keep_corpus": {
66
+ "sft_train": {
67
+ "texts": 136664,
68
+ "tokens": 33584911,
69
+ "dropped_occurrences": 13397
70
+ },
71
+ "sft_eval": {
72
+ "texts": 1554,
73
+ "tokens": 474010,
74
+ "dropped_occurrences": 43
75
+ },
76
+ "gsm8k_test": {
77
+ "texts": 1228,
78
+ "tokens": 222291,
79
+ "dropped_occurrences": 104
80
+ },
81
+ "mcq": {
82
+ "texts": 19085,
83
+ "tokens": 329220,
84
+ "dropped_occurrences": 26
85
+ }
86
+ },
87
+ "seconds": 35
88
+ }
gemma4-e4b-odia8k/base/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
gemma4-e4b-odia8k/base/tokenizer_config.json ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<bos>",
4
+ "eoc_token": "<channel|>",
5
+ "eos_token": "<eos>",
6
+ "eot_token": "<turn|>",
7
+ "escape_token": "<|\"|>",
8
+ "etc_token": "<tool_call|>",
9
+ "etd_token": "<tool|>",
10
+ "etr_token": "<tool_response|>",
11
+ "mask_token": "<mask>",
12
+ "model_max_length": 1000000000000000019884624838656,
13
+ "pad_token": "<pad>",
14
+ "padding_side": "left",
15
+ "response_schema": {
16
+ "type": "object",
17
+ "properties": {
18
+ "role": {
19
+ "const": "assistant"
20
+ },
21
+ "thinking": {
22
+ "type": "string"
23
+ },
24
+ "content": {
25
+ "type": "string"
26
+ },
27
+ "tool_calls": {
28
+ "x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>",
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "properties": {
33
+ "type": {
34
+ "const": "function"
35
+ },
36
+ "function": {
37
+ "type": "object",
38
+ "x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})",
39
+ "properties": {
40
+ "name": {
41
+ "type": "string"
42
+ },
43
+ "arguments": {
44
+ "type": "object",
45
+ "x-parser": "gemma4-tool-call",
46
+ "additionalProperties": {}
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ },
54
+ "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
55
+ },
56
+ "response_template": {
57
+ "defaults": {
58
+ "role": "assistant"
59
+ },
60
+ "fields": {
61
+ "content": {
62
+ "close": [
63
+ "<turn|>",
64
+ "<|tool_response>",
65
+ "<eos>"
66
+ ],
67
+ "content": "text"
68
+ },
69
+ "thinking": {
70
+ "close": "<channel|>",
71
+ "content": "text",
72
+ "open": "<|channel>thought\n"
73
+ },
74
+ "tool_calls": {
75
+ "close": "<tool_call|>",
76
+ "content": "json",
77
+ "content_args": {
78
+ "string_delims": [
79
+ [
80
+ "<|\"|>",
81
+ "<|\"|>"
82
+ ]
83
+ ],
84
+ "unquoted_keys": true
85
+ },
86
+ "open_pattern": "<\\|tool_call>call:(?P<name>\\w+)",
87
+ "repeats": true,
88
+ "transform": {
89
+ "function": {
90
+ "arguments": "{content}",
91
+ "name": "{name}"
92
+ },
93
+ "type": "function"
94
+ }
95
+ }
96
+ },
97
+ "start_anchor": [
98
+ "<|turn>model\n",
99
+ "<tool_response|>"
100
+ ]
101
+ },
102
+ "soc_token": "<|channel>",
103
+ "sot_token": "<|turn>",
104
+ "stc_token": "<|tool_call>",
105
+ "std_token": "<|tool>",
106
+ "str_token": "<|tool_response>",
107
+ "think_token": "<|think|>",
108
+ "tokenizer_class": "GemmaTokenizer",
109
+ "unk_token": "<unk>"
110
+ }
gemma4-e4b-odia8k/base/verify.json ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "stock_class": "Gemma4ForConditionalGeneration",
3
+ "models": {
4
+ "/root/e12/pruned": {
5
+ "new_tokens": 0,
6
+ "vocab": 153405,
7
+ "params": 6070535466,
8
+ "fertility": {
9
+ "odia_flores": {
10
+ "stock": 4.843,
11
+ "surgered": 4.844
12
+ },
13
+ "english_flores": {
14
+ "stock": 1.238,
15
+ "surgered": 1.239
16
+ },
17
+ "hindi_flores": {
18
+ "stock": 1.378,
19
+ "surgered": 1.626
20
+ },
21
+ "odia_sft_eval": {
22
+ "stock": 4.542,
23
+ "surgered": 4.542
24
+ }
25
+ },
26
+ "roundtrip": "200/200",
27
+ "hf_tokenizer": {
28
+ "class": "GemmaTokenizer",
29
+ "len": 153405,
30
+ "bos": 2,
31
+ "eos": 1,
32
+ "pad": 0,
33
+ "same_ids": true
34
+ },
35
+ "class": "Gemma4ForCausalLM",
36
+ "logits": [
37
+ {
38
+ "lang": "english",
39
+ "tokens": 18,
40
+ "max_abs_logit_diff": 0.0,
41
+ "stock_argmax_kept": 1.0,
42
+ "stock_prob_on_dropped": 0.000226
43
+ },
44
+ {
45
+ "lang": "english",
46
+ "tokens": 17,
47
+ "max_abs_logit_diff": 0.0,
48
+ "stock_argmax_kept": 1.0,
49
+ "stock_prob_on_dropped": 0.000205
50
+ },
51
+ {
52
+ "lang": "odia",
53
+ "tokens": 283,
54
+ "max_abs_logit_diff": 0.0,
55
+ "stock_argmax_kept": 1.0,
56
+ "stock_prob_on_dropped": 0.001872
57
+ },
58
+ {
59
+ "lang": "odia",
60
+ "tokens": 291,
61
+ "max_abs_logit_diff": 0.0,
62
+ "stock_argmax_kept": 1.0,
63
+ "stock_prob_on_dropped": 0.000755
64
+ }
65
+ ],
66
+ "bpb_odia_flores": 0.8525
67
+ },
68
+ "/workspace/e12/gemma4-e4b-odia8k": {
69
+ "new_tokens": 8000,
70
+ "vocab": 161405,
71
+ "params": 6177031466,
72
+ "fertility": {
73
+ "odia_flores": {
74
+ "stock": 4.843,
75
+ "surgered": 1.74
76
+ },
77
+ "english_flores": {
78
+ "stock": 1.238,
79
+ "surgered": 1.239
80
+ },
81
+ "hindi_flores": {
82
+ "stock": 1.378,
83
+ "surgered": 1.626
84
+ },
85
+ "odia_sft_eval": {
86
+ "stock": 4.542,
87
+ "surgered": 1.857
88
+ }
89
+ },
90
+ "roundtrip": "200/200",
91
+ "hf_tokenizer": {
92
+ "class": "GemmaTokenizer",
93
+ "len": 161405,
94
+ "bos": 2,
95
+ "eos": 1,
96
+ "pad": 0,
97
+ "same_ids": true
98
+ },
99
+ "class": "Gemma4ForCausalLM",
100
+ "logits": [
101
+ {
102
+ "lang": "english",
103
+ "tokens": 18,
104
+ "max_abs_logit_diff": 0.0,
105
+ "stock_argmax_kept": 1.0,
106
+ "stock_prob_on_dropped": 0.000226
107
+ },
108
+ {
109
+ "lang": "english",
110
+ "tokens": 17,
111
+ "max_abs_logit_diff": 0.0,
112
+ "stock_argmax_kept": 1.0,
113
+ "stock_prob_on_dropped": 0.000205
114
+ },
115
+ {
116
+ "lang": "odia",
117
+ "skipped": "the surgered tokenizer segments it differently"
118
+ },
119
+ {
120
+ "lang": "odia",
121
+ "skipped": "the surgered tokenizer segments it differently"
122
+ }
123
+ ],
124
+ "bpb_odia_flores": 1.2032
125
+ }
126
+ },
127
+ "stock_bpb_odia_flores": 0.856
128
+ }
gemma4-e4b-odia8k/base/vocab_report.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "odia_words": 15784058,
3
+ "odia_distinct_words": 177409,
4
+ "learned": 22993,
5
+ "min_frequency": 100,
6
+ "hindi_share": 0.25,
7
+ "sizes": [
8
+ {
9
+ "new_tokens": "stock",
10
+ "vocab": 262144,
11
+ "odia_flores": 4.843,
12
+ "english_flores": 1.238,
13
+ "hindi_flores": 1.378,
14
+ "odia_sft_eval": 4.542
15
+ },
16
+ {
17
+ "new_tokens": 0,
18
+ "vocab": 153405,
19
+ "odia_flores": 4.844,
20
+ "english_flores": 1.239,
21
+ "hindi_flores": 1.626,
22
+ "odia_sft_eval": 4.542
23
+ },
24
+ {
25
+ "new_tokens": 4000,
26
+ "vocab": 157405,
27
+ "odia_flores": 1.961,
28
+ "english_flores": 1.239,
29
+ "hindi_flores": 1.626,
30
+ "odia_sft_eval": 2.004,
31
+ "new_token_count_min": 0,
32
+ "new_token_count_p10": 984,
33
+ "new_token_count_median": 2409,
34
+ "new_tokens_unused": 2
35
+ },
36
+ {
37
+ "new_tokens": 8000,
38
+ "vocab": 161405,
39
+ "odia_flores": 1.74,
40
+ "english_flores": 1.239,
41
+ "hindi_flores": 1.626,
42
+ "odia_sft_eval": 1.857,
43
+ "new_token_count_min": 0,
44
+ "new_token_count_p10": 375,
45
+ "new_token_count_median": 932,
46
+ "new_tokens_unused": 13
47
+ },
48
+ {
49
+ "new_tokens": 16000,
50
+ "vocab": 169405,
51
+ "odia_flores": 1.591,
52
+ "english_flores": 1.239,
53
+ "hindi_flores": 1.626,
54
+ "odia_sft_eval": 1.762,
55
+ "new_token_count_min": 0,
56
+ "new_token_count_p10": 154,
57
+ "new_token_count_median": 339,
58
+ "new_tokens_unused": 74
59
+ }
60
+ ],
61
+ "kinds": {
62
+ "byte": {
63
+ "kept": 256,
64
+ "dropped": 0
65
+ },
66
+ "english": {
67
+ "kept": 146916,
68
+ "dropped": 0
69
+ },
70
+ "hindi": {
71
+ "kept": 3532,
72
+ "dropped": 10146
73
+ },
74
+ "letter": {
75
+ "kept": 872,
76
+ "dropped": 0
77
+ },
78
+ "math": {
79
+ "kept": 422,
80
+ "dropped": 0
81
+ },
82
+ "multimodal": {
83
+ "kept": 0,
84
+ "dropped": 7
85
+ },
86
+ "odia": {
87
+ "kept": 134,
88
+ "dropped": 0
89
+ },
90
+ "other": {
91
+ "kept": 0,
92
+ "dropped": 93583
93
+ },
94
+ "special": {
95
+ "kept": 17,
96
+ "dropped": 0
97
+ },
98
+ "symbol": {
99
+ "kept": 32,
100
+ "dropped": 0
101
+ },
102
+ "unused": {
103
+ "kept": 0,
104
+ "dropped": 6227
105
+ }
106
+ }
107
+ }