DuoNeural commited on
Commit
bafa988
·
verified ·
1 Parent(s): 9c6a47e

Add GhostShell-4B BF16 merged weights — Gemma4-E4B abliterated + SFT

Browse files
.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,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- macro format_parameters(properties, required) -%}
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 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([])) -}}
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 ns = namespace(prev_message_type=None) -%}
176
+ {%- set loop_messages = messages -%}
177
+ {{- bos_token -}}
178
+ {#- Handle System/Tool Definitions Block -#}
179
+ {%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
180
+ {{- '<|turn>system\n' -}}
181
+
182
+ {#- Inject Thinking token at the very top of the FIRST system turn -#}
183
+ {%- if enable_thinking is defined and enable_thinking -%}
184
+ {{- '<|think|>\n' -}}
185
+ {%- set ns.prev_message_type = 'think' -%}
186
+ {%- endif -%}
187
+
188
+ {%- if messages[0]['role'] in ['system', 'developer'] -%}
189
+ {{- messages[0]['content'] | trim -}}
190
+ {%- set loop_messages = messages[1:] -%}
191
+ {%- endif -%}
192
+
193
+ {%- if tools -%}
194
+ {%- for tool in tools %}
195
+ {{- '<|tool>' -}}
196
+ {{- format_function_declaration(tool) | trim -}}
197
+ {{- '<tool|>' -}}
198
+ {%- endfor %}
199
+ {%- set ns.prev_message_type = 'tool' -%}
200
+ {%- endif -%}
201
+
202
+ {{- '<turn|>\n' -}}
203
+ {%- endif %}
204
+
205
+ {#- Pre-scan: find last user message index for reasoning guard -#}
206
+ {%- set ns_turn = namespace(last_user_idx=-1) -%}
207
+ {%- for i in range(loop_messages | length) -%}
208
+ {%- if loop_messages[i]['role'] == 'user' -%}
209
+ {%- set ns_turn.last_user_idx = i -%}
210
+ {%- endif -%}
211
+ {%- endfor -%}
212
+
213
+ {#- Loop through messages -#}
214
+ {%- for message in loop_messages -%}
215
+ {%- if message['role'] != 'tool' -%}
216
+ {%- set ns.prev_message_type = None -%}
217
+ {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
218
+ {#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
219
+ {%- set prev_nt = namespace(role=None, found=false) -%}
220
+ {%- if loop.index0 > 0 -%}
221
+ {%- for j in range(loop.index0 - 1, -1, -1) -%}
222
+ {%- if not prev_nt.found -%}
223
+ {%- if loop_messages[j]['role'] != 'tool' -%}
224
+ {%- set prev_nt.role = loop_messages[j]['role'] -%}
225
+ {%- set prev_nt.found = true -%}
226
+ {%- endif -%}
227
+ {%- endif -%}
228
+ {%- endfor -%}
229
+ {%- endif -%}
230
+ {%- set continue_same_model_turn = (role == 'model' and prev_nt.role == 'assistant') -%}
231
+ {%- if not continue_same_model_turn -%}
232
+ {{- '<|turn>' + role + '\n' }}
233
+ {%- endif -%}
234
+
235
+ {#- Render reasoning/reasoning_content as thinking channel -#}
236
+ {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
237
+ {%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
238
+ {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
239
+ {%- endif -%}
240
+
241
+ {%- if message['tool_calls'] -%}
242
+ {%- for tool_call in message['tool_calls'] -%}
243
+ {%- set function = tool_call['function'] -%}
244
+ {{- '<|tool_call>call:' + function['name'] + '{' -}}
245
+ {%- if function['arguments'] is mapping -%}
246
+ {%- set ns_args = namespace(found_first=false) -%}
247
+ {%- for key, value in function['arguments'] | dictsort -%}
248
+ {%- if ns_args.found_first %},{% endif -%}
249
+ {%- set ns_args.found_first = true -%}
250
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
251
+ {%- endfor -%}
252
+ {%- elif function['arguments'] is string -%}
253
+ {{- function['arguments'] -}}
254
+ {%- endif -%}
255
+ {{- '}<tool_call|>' -}}
256
+ {%- endfor -%}
257
+ {%- set ns.prev_message_type = 'tool_call' -%}
258
+ {%- endif -%}
259
+
260
+ {%- set ns_tr_out = namespace(flag=false) -%}
261
+ {%- if message.get('tool_responses') -%}
262
+ {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
263
+ {%- for tool_response in message['tool_responses'] -%}
264
+ {{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
265
+ {%- set ns_tr_out.flag = true -%}
266
+ {%- set ns.prev_message_type = 'tool_response' -%}
267
+ {%- endfor -%}
268
+ {%- elif message.get('tool_calls') -%}
269
+ {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
270
+ {%- set ns_tool_scan = namespace(stopped=false) -%}
271
+ {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
272
+ {%- if ns_tool_scan.stopped -%}
273
+ {%- elif loop_messages[k]['role'] != 'tool' -%}
274
+ {%- set ns_tool_scan.stopped = true -%}
275
+ {%- else -%}
276
+ {%- set follow = loop_messages[k] -%}
277
+ {#- Resolve tool_call_id to function name -#}
278
+ {%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
279
+ {%- for tc in message['tool_calls'] -%}
280
+ {%- if tc.get('id') == follow.get('tool_call_id') -%}
281
+ {%- set ns_tname.name = tc['function']['name'] -%}
282
+ {%- endif -%}
283
+ {%- endfor -%}
284
+ {#- Handle content as string or content-parts array -#}
285
+ {%- set tool_body = follow.get('content') -%}
286
+ {%- if tool_body is string -%}
287
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
288
+ {%- elif tool_body is sequence and tool_body is not string -%}
289
+ {%- set ns_txt = namespace(s='') -%}
290
+ {%- for part in tool_body -%}
291
+ {%- if part.get('type') == 'text' -%}
292
+ {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
293
+ {%- endif -%}
294
+ {%- endfor -%}
295
+ {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
296
+ {%- else -%}
297
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
298
+ {%- endif -%}
299
+ {%- set ns_tr_out.flag = true -%}
300
+ {%- set ns.prev_message_type = 'tool_response' -%}
301
+ {%- endif -%}
302
+ {%- endfor -%}
303
+ {%- endif -%}
304
+
305
+ {%- if message['content'] is string -%}
306
+ {%- if role == 'model' -%}
307
+ {{- strip_thinking(message['content']) -}}
308
+ {%- else -%}
309
+ {{- message['content'] | trim -}}
310
+ {%- endif -%}
311
+ {%- elif message['content'] is sequence -%}
312
+ {%- for item in message['content'] -%}
313
+ {%- if item['type'] == 'text' -%}
314
+ {%- if role == 'model' -%}
315
+ {{- strip_thinking(item['text']) -}}
316
+ {%- else -%}
317
+ {{- item['text'] | trim -}}
318
+ {%- endif -%}
319
+ {%- elif item['type'] == 'image' -%}
320
+ {{- '<|image|>' -}}
321
+ {%- set ns.prev_message_type = 'image' -%}
322
+ {%- elif item['type'] == 'audio' -%}
323
+ {{- '<|audio|>' -}}
324
+ {%- set ns.prev_message_type = 'audio' -%}
325
+ {%- elif item['type'] == 'video' -%}
326
+ {{- '<|video|>' -}}
327
+ {%- set ns.prev_message_type = 'video' -%}
328
+ {%- endif -%}
329
+ {%- endfor -%}
330
+ {%- endif -%}
331
+
332
+ {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
333
+ {{- '<|tool_response>' -}}
334
+ {%- elif not (ns_tr_out.flag and not message.get('content')) -%}
335
+ {{- '<turn|>\n' -}}
336
+ {%- endif -%}
337
+ {%- endif -%}
338
+ {%- endfor -%}
339
+
340
+ {%- if add_generation_prompt -%}
341
+ {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
342
+ {{- '<|turn>model\n' -}}
343
+ {%- endif -%}
344
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma4ForConditionalGeneration"
4
+ ],
5
+ "audio_config": {
6
+ "_name_or_path": "",
7
+ "architectures": null,
8
+ "attention_chunk_size": 12,
9
+ "attention_context_left": 13,
10
+ "attention_context_right": 0,
11
+ "attention_invalid_logits_value": -1000000000.0,
12
+ "attention_logit_cap": 50.0,
13
+ "chunk_size_feed_forward": 0,
14
+ "conv_kernel_size": 5,
15
+ "dtype": "bfloat16",
16
+ "gradient_clipping": 10000000000.0,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 1024,
19
+ "id2label": {
20
+ "0": "LABEL_0",
21
+ "1": "LABEL_1"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "is_encoder_decoder": false,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1
28
+ },
29
+ "model_type": "gemma4_audio",
30
+ "num_attention_heads": 8,
31
+ "num_hidden_layers": 12,
32
+ "output_attentions": false,
33
+ "output_hidden_states": false,
34
+ "output_proj_dims": 1536,
35
+ "problem_type": null,
36
+ "residual_weight": 0.5,
37
+ "return_dict": true,
38
+ "rms_norm_eps": 1e-06,
39
+ "subsampling_conv_channels": [
40
+ 128,
41
+ 32
42
+ ],
43
+ "use_clipped_linears": true
44
+ },
45
+ "audio_token_id": 258881,
46
+ "boa_token_id": 256000,
47
+ "boi_token_id": 255999,
48
+ "bos_token_id": 2,
49
+ "dtype": "bfloat16",
50
+ "eoa_token_id": 258883,
51
+ "eoa_token_index": 258883,
52
+ "eoi_token_id": 258882,
53
+ "eos_token_id": 1,
54
+ "image_token_id": 258880,
55
+ "initializer_range": 0.02,
56
+ "model_type": "gemma4",
57
+ "pad_token_id": 0,
58
+ "text_config": {
59
+ "attention_bias": false,
60
+ "attention_dropout": 0.0,
61
+ "attention_k_eq_v": false,
62
+ "bos_token_id": 2,
63
+ "dtype": "bfloat16",
64
+ "enable_moe_block": false,
65
+ "eos_token_id": 1,
66
+ "expert_intermediate_size": null,
67
+ "final_logit_softcapping": 30.0,
68
+ "global_head_dim": 512,
69
+ "head_dim": 256,
70
+ "hidden_activation": "gelu_pytorch_tanh",
71
+ "hidden_size": 2560,
72
+ "hidden_size_per_layer_input": 256,
73
+ "initializer_range": 0.02,
74
+ "intermediate_size": 10240,
75
+ "layer_types": [
76
+ "sliding_attention",
77
+ "sliding_attention",
78
+ "sliding_attention",
79
+ "sliding_attention",
80
+ "sliding_attention",
81
+ "full_attention",
82
+ "sliding_attention",
83
+ "sliding_attention",
84
+ "sliding_attention",
85
+ "sliding_attention",
86
+ "sliding_attention",
87
+ "full_attention",
88
+ "sliding_attention",
89
+ "sliding_attention",
90
+ "sliding_attention",
91
+ "sliding_attention",
92
+ "sliding_attention",
93
+ "full_attention",
94
+ "sliding_attention",
95
+ "sliding_attention",
96
+ "sliding_attention",
97
+ "sliding_attention",
98
+ "sliding_attention",
99
+ "full_attention",
100
+ "sliding_attention",
101
+ "sliding_attention",
102
+ "sliding_attention",
103
+ "sliding_attention",
104
+ "sliding_attention",
105
+ "full_attention",
106
+ "sliding_attention",
107
+ "sliding_attention",
108
+ "sliding_attention",
109
+ "sliding_attention",
110
+ "sliding_attention",
111
+ "full_attention",
112
+ "sliding_attention",
113
+ "sliding_attention",
114
+ "sliding_attention",
115
+ "sliding_attention",
116
+ "sliding_attention",
117
+ "full_attention"
118
+ ],
119
+ "max_position_embeddings": 131072,
120
+ "model_type": "gemma4_text",
121
+ "moe_intermediate_size": null,
122
+ "num_attention_heads": 8,
123
+ "num_experts": null,
124
+ "num_global_key_value_heads": null,
125
+ "num_hidden_layers": 42,
126
+ "num_key_value_heads": 2,
127
+ "num_kv_shared_layers": 18,
128
+ "pad_token_id": 0,
129
+ "rms_norm_eps": 1e-06,
130
+ "rope_parameters": {
131
+ "full_attention": {
132
+ "partial_rotary_factor": 0.25,
133
+ "rope_theta": 1000000.0,
134
+ "rope_type": "proportional"
135
+ },
136
+ "sliding_attention": {
137
+ "rope_theta": 10000.0,
138
+ "rope_type": "default"
139
+ }
140
+ },
141
+ "sliding_window": 512,
142
+ "tie_word_embeddings": true,
143
+ "top_k_experts": null,
144
+ "use_bidirectional_attention": null,
145
+ "use_cache": true,
146
+ "use_double_wide_mlp": false,
147
+ "vocab_size": 262144,
148
+ "vocab_size_per_layer_input": 262144
149
+ },
150
+ "tie_word_embeddings": true,
151
+ "transformers_version": "5.6.0.dev0",
152
+ "use_cache": false,
153
+ "video_token_id": 258884,
154
+ "vision_config": {
155
+ "_name_or_path": "",
156
+ "architectures": null,
157
+ "attention_bias": false,
158
+ "attention_dropout": 0.0,
159
+ "chunk_size_feed_forward": 0,
160
+ "default_output_length": 280,
161
+ "dtype": "bfloat16",
162
+ "global_head_dim": 64,
163
+ "head_dim": 64,
164
+ "hidden_activation": "gelu_pytorch_tanh",
165
+ "hidden_size": 768,
166
+ "id2label": {
167
+ "0": "LABEL_0",
168
+ "1": "LABEL_1"
169
+ },
170
+ "initializer_range": 0.02,
171
+ "intermediate_size": 3072,
172
+ "is_encoder_decoder": false,
173
+ "label2id": {
174
+ "LABEL_0": 0,
175
+ "LABEL_1": 1
176
+ },
177
+ "max_position_embeddings": 131072,
178
+ "model_type": "gemma4_vision",
179
+ "num_attention_heads": 12,
180
+ "num_hidden_layers": 16,
181
+ "num_key_value_heads": 12,
182
+ "output_attentions": false,
183
+ "output_hidden_states": false,
184
+ "patch_size": 16,
185
+ "pooling_kernel_size": 3,
186
+ "position_embedding_size": 10240,
187
+ "problem_type": null,
188
+ "return_dict": true,
189
+ "rms_norm_eps": 1e-06,
190
+ "rope_parameters": {
191
+ "rope_theta": 100.0,
192
+ "rope_type": "default"
193
+ },
194
+ "standardize": false,
195
+ "use_clipped_linears": true
196
+ },
197
+ "vision_soft_tokens_per_image": 280
198
+ }
generation_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 1,
6
+ 1,
7
+ 106,
8
+ 50
9
+ ],
10
+ "pad_token_id": 0,
11
+ "temperature": 1.0,
12
+ "top_k": 64,
13
+ "top_p": 0.95,
14
+ "transformers_version": "5.6.0.dev0"
15
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa3e9d1e0443f9874260af4efbe8f0aa4c8fed25d41c9ca172e4c354d101c709
3
+ size 5637144744
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf4cd53f5bd2a7e8d0163fddff5d1345a6b167855ecb78362f845c9f748f0546
3
+ size 4994512034
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a9f0f83bcf2b4e112eaa1c3ee6a1f2ed19d3cd16e9018aa330f1bb26a65123b
3
+ size 4996188746
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b15f8e5e8ce263f04d5309bb8c2ac437df348717b71b60afb9dcbfab1d54c7c
3
+ size 254506792
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
3
+ size 32169626
tokenizer_config.json ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_token": "<|audio|>",
3
+ "backend": "tokenizers",
4
+ "boa_token": "<|audio>",
5
+ "boi_token": "<|image>",
6
+ "bos_token": "<bos>",
7
+ "eoa_token": "<audio|>",
8
+ "eoc_token": "<channel|>",
9
+ "eoi_token": "<image|>",
10
+ "eos_token": "<eos>",
11
+ "eot_token": "<turn|>",
12
+ "escape_token": "<|\"|>",
13
+ "etc_token": "<tool_call|>",
14
+ "etd_token": "<tool|>",
15
+ "etr_token": "<tool_response|>",
16
+ "extra_special_tokens": [
17
+ "<|video|>"
18
+ ],
19
+ "image_token": "<|image|>",
20
+ "is_local": true,
21
+ "local_files_only": false,
22
+ "mask_token": "<mask>",
23
+ "max_length": 256,
24
+ "model_max_length": 1000000000000000019884624838656,
25
+ "model_specific_special_tokens": {
26
+ "audio_token": "<|audio|>",
27
+ "boa_token": "<|audio>",
28
+ "boi_token": "<|image>",
29
+ "eoa_token": "<audio|>",
30
+ "eoc_token": "<channel|>",
31
+ "eoi_token": "<image|>",
32
+ "eot_token": "<turn|>",
33
+ "escape_token": "<|\"|>",
34
+ "etc_token": "<tool_call|>",
35
+ "etd_token": "<tool|>",
36
+ "etr_token": "<tool_response|>",
37
+ "image_token": "<|image|>",
38
+ "soc_token": "<|channel>",
39
+ "sot_token": "<|turn>",
40
+ "stc_token": "<|tool_call>",
41
+ "std_token": "<|tool>",
42
+ "str_token": "<|tool_response>",
43
+ "think_token": "<|think|>"
44
+ },
45
+ "pad_token": "<pad>",
46
+ "padding_side": "right",
47
+ "processor_class": "Gemma4Processor",
48
+ "response_schema": {
49
+ "properties": {
50
+ "content": {
51
+ "type": "string"
52
+ },
53
+ "role": {
54
+ "const": "assistant"
55
+ },
56
+ "thinking": {
57
+ "type": "string"
58
+ },
59
+ "tool_calls": {
60
+ "items": {
61
+ "properties": {
62
+ "function": {
63
+ "properties": {
64
+ "arguments": {
65
+ "additionalProperties": {},
66
+ "type": "object",
67
+ "x-parser": "gemma4-tool-call"
68
+ },
69
+ "name": {
70
+ "type": "string"
71
+ }
72
+ },
73
+ "type": "object",
74
+ "x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
75
+ },
76
+ "type": {
77
+ "const": "function"
78
+ }
79
+ },
80
+ "type": "object"
81
+ },
82
+ "type": "array",
83
+ "x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
84
+ }
85
+ },
86
+ "type": "object",
87
+ "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
88
+ },
89
+ "soc_token": "<|channel>",
90
+ "sot_token": "<|turn>",
91
+ "stc_token": "<|tool_call>",
92
+ "std_token": "<|tool>",
93
+ "str_token": "<|tool_response>",
94
+ "stride": 0,
95
+ "think_token": "<|think|>",
96
+ "tokenizer_class": "GemmaTokenizer",
97
+ "truncation_side": "right",
98
+ "truncation_strategy": "longest_first",
99
+ "unk_token": "<unk>"
100
+ }