ImAXISOG commited on
Commit
0176b28
·
verified ·
1 Parent(s): 8b0afb9

Iris Gemma 4: first release

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
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://ai.google.dev/gemma/docs/gemma_4_license
4
+ base_model: google/gemma-4-E2B-it
5
+ base_model_relation: finetune
6
+ library_name: mlx
7
+ language:
8
+ - en
9
+ - hi
10
+ pipeline_tag: text-generation
11
+ tags:
12
+ - gemma4
13
+ - grammar
14
+ - writing
15
+ - iris
16
+ ---
17
+
18
+ # Iris Gemma 4 E2B (MLX)
19
+
20
+ The on-device writing model of Iris, a grammar and tone app for macOS and Windows, "Lighter" in the app: Fix
21
+ corrects spelling, grammar and punctuation and changes nothing else; the tones (Professional, Friendly, Shorter,
22
+ Clearer, Funny) rewrite a message while keeping its meaning and the writer's voice. English, Hindi (Devanagari) and
23
+ Hinglish (Hindi typed in English letters).
24
+
25
+ **This is a modified version of Google's [google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it)**, released under the
26
+ Apache License 2.0 (`LICENSE`). Changes: fine-tuned with LoRA on writing examples (written and reviewed with AI models,
27
+ then filtered so none resemble the test drafts below), the adapter merged into the weights, weights 4-bit, audio
28
+ weights removed. Same format: [iris-gemma-4-e2b-it-gguf](https://huggingface.co/ImAXISOG/iris-gemma-4-e2b-it-gguf).
29
+
30
+ ## How it was tested
31
+
32
+ Blind-judged answer by answer on drafts written for testing only (no training example was taken from them), against
33
+ Google's untrained Gemma 4 E4B-it, at temperature 0 with Iris's own short prompts:
34
+
35
+ | | Gemma 4 E4B-it (untrained, the larger model) | **This model** |
36
+ |---|---|---|
37
+ | Fix, English (50 drafts): accepted | 52% | **86%** |
38
+ | Professional and Friendly (100): would send | 86% | **88%** |
39
+ | Shorter and Clearer (100): would send | 75% | **86%** |
40
+ | Funny (50): would send | 4% | **56%** |
41
+ | Fix, Hindi and Hinglish (82): accepted | 91% | **71%** |
42
+ | Hindi tones (240): would send | 71% | **47%** |
43
+
44
+ Against the untrained Gemma 4 E2B-it, judged in other rounds: Hindi Fix 62-65% vs 63% (no change), Hindi tones
45
+ would send 47% vs 36%, English Fix 86% vs 60% (measured on the previous training round, which shares its English
46
+ examples). For Hindi, the E4B model is clearly better.
47
+
48
+ - Mac: 2.9 GB peak memory on short messages and 3.2 GB at 6,000 characters on Apple silicon, with the trims below; about 0.2 s an answer.
49
+ - Windows (the GGUF format): 3.4 GB file; about 1 s an answer on a laptop processor alone; about 5.4 GB in use including the mapped file, so it should fit 8 GB of RAM (measured on a Mac's processor; not yet on a real Windows laptop).
50
+
51
+ Not tested yet: an 8 GB Mac or a real Windows laptop, long documents for quality (memory only), custom tones, writers'
52
+ own style rules.
53
+
54
+ ## Using it
55
+
56
+ Load it with mlx-swift-lm's `MLXVLM` (what Iris uses) or another MLX loader that reads Gemma 4. The audio weights are
57
+ removed; the picture weights are kept so stock loaders work. Iris pairs it with the drafter
58
+ [mlx-community/gemma-4-E2B-it-qat-assistant-bf16](https://huggingface.co/mlx-community/gemma-4-E2B-it-qat-assistant-bf16).
59
+
60
+ Iris also keeps the per-layer word table (`embed_tokens_per_layer`) on disk and reads only the rows each token needs,
61
+ and drops the picture layers at load: the answers stay word for word the same and memory falls to the figures above.
62
+ A stock loader holds everything in memory and peaks higher (about 4.8 GB).
63
+
64
+ The model was trained with Iris's short instructions for each mode and thinking turned off; other prompts work but
65
+ were not measured.
chat_template.jinja ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 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
+ {#- Inject Thinking token at the very top of the FIRST system turn -#}
182
+ {%- if enable_thinking is defined and enable_thinking -%}
183
+ {{- '<|think|>\n' -}}
184
+ {%- set ns.prev_message_type = 'think' -%}
185
+ {%- endif -%}
186
+ {%- if messages[0]['role'] in ['system', 'developer'] -%}
187
+ {%- if messages[0]['content'] is string -%}
188
+ {{- messages[0]['content'] | trim -}}
189
+ {%- elif messages[0]['content'] is sequence -%}
190
+ {%- for item in messages[0]['content'] -%}
191
+ {{- item['text'] | trim + ' '-}}
192
+ {%- endfor -%}
193
+ {%- endif -%}
194
+ {%- set loop_messages = messages[1:] -%}
195
+ {%- endif -%}
196
+ {%- if tools -%}
197
+ {%- for tool in tools %}
198
+ {{- '<|tool>' -}}
199
+ {{- format_function_declaration(tool) | trim -}}
200
+ {{- '<tool|>' -}}
201
+ {%- endfor %}
202
+ {%- set ns.prev_message_type = 'tool' -%}
203
+ {%- endif -%}
204
+ {{- '<turn|>\n' -}}
205
+ {%- endif %}
206
+
207
+ {#- Pre-scan: find last user message index for reasoning guard -#}
208
+ {%- set ns_turn = namespace(last_user_idx=-1) -%}
209
+ {%- for i in range(loop_messages | length) -%}
210
+ {%- if loop_messages[i]['role'] == 'user' -%}
211
+ {%- set ns_turn.last_user_idx = i -%}
212
+ {%- endif -%}
213
+ {%- endfor -%}
214
+
215
+ {#- Loop through messages -#}
216
+ {%- for message in loop_messages -%}
217
+ {%- if message['role'] != 'tool' -%}
218
+ {%- set ns.prev_message_type = None -%}
219
+ {%- set role = 'model' if message['role'] == 'assistant' else message['role'] -%}
220
+ {#- Detect continuation: suppress duplicate <|turn>model when previous non-tool message was also assistant -#}
221
+ {%- set prev_nt = namespace(role=None, found=false) -%}
222
+ {%- if loop.index0 > 0 -%}
223
+ {%- for j in range(loop.index0 - 1, -1, -1) -%}
224
+ {%- if not prev_nt.found -%}
225
+ {%- if loop_messages[j]['role'] != 'tool' -%}
226
+ {%- set prev_nt.role = loop_messages[j]['role'] -%}
227
+ {%- set prev_nt.found = true -%}
228
+ {%- endif -%}
229
+ {%- endif -%}
230
+ {%- endfor -%}
231
+ {%- endif -%}
232
+ {%- set continue_same_model_turn = (role == 'model' and prev_nt.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
+ {%- if thinking_text and loop.index0 > ns_turn.last_user_idx and message.get('tool_calls') -%}
240
+ {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
241
+ {%- endif -%}
242
+
243
+ {%- if message['tool_calls'] -%}
244
+ {%- for tool_call in message['tool_calls'] -%}
245
+ {%- set function = tool_call['function'] -%}
246
+ {{- '<|tool_call>call:' + function['name'] + '{' -}}
247
+ {%- if function['arguments'] is mapping -%}
248
+ {%- set ns_args = namespace(found_first=false) -%}
249
+ {%- for key, value in function['arguments'] | dictsort -%}
250
+ {%- if ns_args.found_first %},{% endif -%}
251
+ {%- set ns_args.found_first = true -%}
252
+ {{- key -}}:{{- format_argument(value, escape_keys=False) -}}
253
+ {%- endfor -%}
254
+ {%- elif function['arguments'] is string -%}
255
+ {{- function['arguments'] -}}
256
+ {%- endif -%}
257
+ {{- '}<tool_call|>' -}}
258
+ {%- endfor -%}
259
+ {%- set ns.prev_message_type = 'tool_call' -%}
260
+ {%- endif -%}
261
+
262
+ {%- set ns_tr_out = namespace(flag=false) -%}
263
+ {%- if message.get('tool_responses') -%}
264
+ {#- Legacy: tool_responses embedded on the assistant message (Google/Gemma native) -#}
265
+ {%- for tool_response in message['tool_responses'] -%}
266
+ {{- format_tool_response_block(tool_response['name'] | default('unknown'), tool_response['response']) -}}
267
+ {%- set ns_tr_out.flag = true -%}
268
+ {%- set ns.prev_message_type = 'tool_response' -%}
269
+ {%- endfor -%}
270
+ {%- elif message.get('tool_calls') -%}
271
+ {#- OpenAI Chat Completions: forward-scan consecutive role:tool messages -#}
272
+ {%- set ns_tool_scan = namespace(stopped=false) -%}
273
+ {%- for k in range(loop.index0 + 1, loop_messages | length) -%}
274
+ {%- if ns_tool_scan.stopped -%}
275
+ {%- elif loop_messages[k]['role'] != 'tool' -%}
276
+ {%- set ns_tool_scan.stopped = true -%}
277
+ {%- else -%}
278
+ {%- set follow = loop_messages[k] -%}
279
+ {#- Resolve tool_call_id to function name -#}
280
+ {%- set ns_tname = namespace(name=follow.get('name') | default('unknown')) -%}
281
+ {%- for tc in message['tool_calls'] -%}
282
+ {%- if tc.get('id') == follow.get('tool_call_id') -%}
283
+ {%- set ns_tname.name = tc['function']['name'] -%}
284
+ {%- endif -%}
285
+ {%- endfor -%}
286
+ {#- Handle content as string or content-parts array -#}
287
+ {%- set tool_body = follow.get('content') -%}
288
+ {%- if tool_body is string -%}
289
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
290
+ {%- elif tool_body is sequence and tool_body is not string -%}
291
+ {%- set ns_txt = namespace(s='') -%}
292
+ {%- for part in tool_body -%}
293
+ {%- if part.get('type') == 'text' -%}
294
+ {%- set ns_txt.s = ns_txt.s + (part.get('text') | default('')) -%}
295
+ {%- endif -%}
296
+ {%- endfor -%}
297
+ {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
298
+ {%- else -%}
299
+ {{- format_tool_response_block(ns_tname.name, tool_body) -}}
300
+ {%- endif -%}
301
+ {%- set ns_tr_out.flag = true -%}
302
+ {%- set ns.prev_message_type = 'tool_response' -%}
303
+ {%- endif -%}
304
+ {%- endfor -%}
305
+ {%- endif -%}
306
+
307
+ {%- set captured_content -%}
308
+ {%- if message['content'] is string -%}
309
+ {%- if role == 'model' -%}
310
+ {{- strip_thinking(message['content']) -}}
311
+ {%- else -%}
312
+ {{- message['content'] | trim -}}
313
+ {%- endif -%}
314
+ {%- elif message['content'] is sequence -%}
315
+ {%- for item in message['content'] -%}
316
+ {%- if item['type'] == 'text' -%}
317
+ {%- if role == 'model' -%}
318
+ {{- strip_thinking(item['text']) -}}
319
+ {%- else -%}
320
+ {{- item['text'] | trim -}}
321
+ {%- endif -%}
322
+ {%- elif item['type'] == 'image' -%}
323
+ {{- '<|image|>' -}}
324
+ {%- set ns.prev_message_type = 'image' -%}
325
+ {%- elif item['type'] == 'audio' -%}
326
+ {{- '<|audio|>' -}}
327
+ {%- set ns.prev_message_type = 'audio' -%}
328
+ {%- elif item['type'] == 'video' -%}
329
+ {{- '<|video|>' -}}
330
+ {%- set ns.prev_message_type = 'video' -%}
331
+ {%- endif -%}
332
+ {%- endfor -%}
333
+ {%- endif -%}
334
+ {%- endset -%}
335
+
336
+ {{- captured_content -}}
337
+ {%- set has_content = captured_content | trim | length > 0 -%}
338
+
339
+ {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
340
+ {{- '<|tool_response>' -}}
341
+ {%- elif not (ns_tr_out.flag and not has_content) -%}
342
+ {{- '<turn|>\n' -}}
343
+ {%- endif -%}
344
+ {%- endif -%}
345
+ {%- endfor -%}
346
+
347
+ {%- if add_generation_prompt -%}
348
+ {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
349
+ {{- '<|turn>model\n' -}}
350
+ {%- endif -%}
351
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,1041 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "dtype": "bfloat16",
49
+ "eoa_token_id": 258883,
50
+ "eoa_token_index": 258883,
51
+ "eoi_token_id": 258882,
52
+ "eos_token_id": [
53
+ 1,
54
+ 106,
55
+ 50
56
+ ],
57
+ "image_token_id": 258880,
58
+ "initializer_range": 0.02,
59
+ "model_type": "gemma4",
60
+ "quantization": {
61
+ "group_size": 64,
62
+ "bits": 4,
63
+ "mode": "affine",
64
+ "language_model.model.layers.0.mlp.gate_proj": {
65
+ "group_size": 64,
66
+ "bits": 8
67
+ },
68
+ "language_model.model.layers.0.mlp.down_proj": {
69
+ "group_size": 64,
70
+ "bits": 8
71
+ },
72
+ "language_model.model.layers.0.mlp.up_proj": {
73
+ "group_size": 64,
74
+ "bits": 8
75
+ },
76
+ "language_model.model.layers.1.mlp.gate_proj": {
77
+ "group_size": 64,
78
+ "bits": 8
79
+ },
80
+ "language_model.model.layers.1.mlp.down_proj": {
81
+ "group_size": 64,
82
+ "bits": 8
83
+ },
84
+ "language_model.model.layers.1.mlp.up_proj": {
85
+ "group_size": 64,
86
+ "bits": 8
87
+ },
88
+ "language_model.model.layers.2.mlp.gate_proj": {
89
+ "group_size": 64,
90
+ "bits": 8
91
+ },
92
+ "language_model.model.layers.2.mlp.down_proj": {
93
+ "group_size": 64,
94
+ "bits": 8
95
+ },
96
+ "language_model.model.layers.2.mlp.up_proj": {
97
+ "group_size": 64,
98
+ "bits": 8
99
+ },
100
+ "language_model.model.layers.3.mlp.gate_proj": {
101
+ "group_size": 64,
102
+ "bits": 8
103
+ },
104
+ "language_model.model.layers.3.mlp.down_proj": {
105
+ "group_size": 64,
106
+ "bits": 8
107
+ },
108
+ "language_model.model.layers.3.mlp.up_proj": {
109
+ "group_size": 64,
110
+ "bits": 8
111
+ },
112
+ "language_model.model.layers.4.mlp.gate_proj": {
113
+ "group_size": 64,
114
+ "bits": 8
115
+ },
116
+ "language_model.model.layers.4.mlp.down_proj": {
117
+ "group_size": 64,
118
+ "bits": 8
119
+ },
120
+ "language_model.model.layers.4.mlp.up_proj": {
121
+ "group_size": 64,
122
+ "bits": 8
123
+ },
124
+ "language_model.model.layers.5.mlp.gate_proj": {
125
+ "group_size": 64,
126
+ "bits": 8
127
+ },
128
+ "language_model.model.layers.5.mlp.down_proj": {
129
+ "group_size": 64,
130
+ "bits": 8
131
+ },
132
+ "language_model.model.layers.5.mlp.up_proj": {
133
+ "group_size": 64,
134
+ "bits": 8
135
+ },
136
+ "language_model.model.layers.6.mlp.gate_proj": {
137
+ "group_size": 64,
138
+ "bits": 8
139
+ },
140
+ "language_model.model.layers.6.mlp.down_proj": {
141
+ "group_size": 64,
142
+ "bits": 8
143
+ },
144
+ "language_model.model.layers.6.mlp.up_proj": {
145
+ "group_size": 64,
146
+ "bits": 8
147
+ },
148
+ "language_model.model.layers.7.mlp.gate_proj": {
149
+ "group_size": 64,
150
+ "bits": 8
151
+ },
152
+ "language_model.model.layers.7.mlp.down_proj": {
153
+ "group_size": 64,
154
+ "bits": 8
155
+ },
156
+ "language_model.model.layers.7.mlp.up_proj": {
157
+ "group_size": 64,
158
+ "bits": 8
159
+ },
160
+ "language_model.model.layers.8.mlp.gate_proj": {
161
+ "group_size": 64,
162
+ "bits": 8
163
+ },
164
+ "language_model.model.layers.8.mlp.down_proj": {
165
+ "group_size": 64,
166
+ "bits": 8
167
+ },
168
+ "language_model.model.layers.8.mlp.up_proj": {
169
+ "group_size": 64,
170
+ "bits": 8
171
+ },
172
+ "language_model.model.layers.9.mlp.gate_proj": {
173
+ "group_size": 64,
174
+ "bits": 8
175
+ },
176
+ "language_model.model.layers.9.mlp.down_proj": {
177
+ "group_size": 64,
178
+ "bits": 8
179
+ },
180
+ "language_model.model.layers.9.mlp.up_proj": {
181
+ "group_size": 64,
182
+ "bits": 8
183
+ },
184
+ "language_model.model.layers.10.mlp.gate_proj": {
185
+ "group_size": 64,
186
+ "bits": 8
187
+ },
188
+ "language_model.model.layers.10.mlp.down_proj": {
189
+ "group_size": 64,
190
+ "bits": 8
191
+ },
192
+ "language_model.model.layers.10.mlp.up_proj": {
193
+ "group_size": 64,
194
+ "bits": 8
195
+ },
196
+ "language_model.model.layers.11.mlp.gate_proj": {
197
+ "group_size": 64,
198
+ "bits": 8
199
+ },
200
+ "language_model.model.layers.11.mlp.down_proj": {
201
+ "group_size": 64,
202
+ "bits": 8
203
+ },
204
+ "language_model.model.layers.11.mlp.up_proj": {
205
+ "group_size": 64,
206
+ "bits": 8
207
+ },
208
+ "language_model.model.layers.12.mlp.gate_proj": {
209
+ "group_size": 64,
210
+ "bits": 8
211
+ },
212
+ "language_model.model.layers.12.mlp.down_proj": {
213
+ "group_size": 64,
214
+ "bits": 8
215
+ },
216
+ "language_model.model.layers.12.mlp.up_proj": {
217
+ "group_size": 64,
218
+ "bits": 8
219
+ },
220
+ "language_model.model.layers.13.mlp.gate_proj": {
221
+ "group_size": 64,
222
+ "bits": 8
223
+ },
224
+ "language_model.model.layers.13.mlp.down_proj": {
225
+ "group_size": 64,
226
+ "bits": 8
227
+ },
228
+ "language_model.model.layers.13.mlp.up_proj": {
229
+ "group_size": 64,
230
+ "bits": 8
231
+ },
232
+ "language_model.model.layers.14.mlp.gate_proj": {
233
+ "group_size": 64,
234
+ "bits": 8
235
+ },
236
+ "language_model.model.layers.14.mlp.down_proj": {
237
+ "group_size": 64,
238
+ "bits": 8
239
+ },
240
+ "language_model.model.layers.14.mlp.up_proj": {
241
+ "group_size": 64,
242
+ "bits": 8
243
+ },
244
+ "language_model.model.layers.15.mlp.gate_proj": {
245
+ "group_size": 64,
246
+ "bits": 8
247
+ },
248
+ "language_model.model.layers.15.mlp.down_proj": {
249
+ "group_size": 64,
250
+ "bits": 8
251
+ },
252
+ "language_model.model.layers.15.mlp.up_proj": {
253
+ "group_size": 64,
254
+ "bits": 8
255
+ },
256
+ "language_model.model.layers.16.mlp.gate_proj": {
257
+ "group_size": 64,
258
+ "bits": 8
259
+ },
260
+ "language_model.model.layers.16.mlp.down_proj": {
261
+ "group_size": 64,
262
+ "bits": 8
263
+ },
264
+ "language_model.model.layers.16.mlp.up_proj": {
265
+ "group_size": 64,
266
+ "bits": 8
267
+ },
268
+ "language_model.model.layers.17.mlp.gate_proj": {
269
+ "group_size": 64,
270
+ "bits": 8
271
+ },
272
+ "language_model.model.layers.17.mlp.down_proj": {
273
+ "group_size": 64,
274
+ "bits": 8
275
+ },
276
+ "language_model.model.layers.17.mlp.up_proj": {
277
+ "group_size": 64,
278
+ "bits": 8
279
+ },
280
+ "language_model.model.layers.18.mlp.gate_proj": {
281
+ "group_size": 64,
282
+ "bits": 8
283
+ },
284
+ "language_model.model.layers.18.mlp.down_proj": {
285
+ "group_size": 64,
286
+ "bits": 8
287
+ },
288
+ "language_model.model.layers.18.mlp.up_proj": {
289
+ "group_size": 64,
290
+ "bits": 8
291
+ },
292
+ "language_model.model.layers.19.mlp.gate_proj": {
293
+ "group_size": 64,
294
+ "bits": 8
295
+ },
296
+ "language_model.model.layers.19.mlp.down_proj": {
297
+ "group_size": 64,
298
+ "bits": 8
299
+ },
300
+ "language_model.model.layers.19.mlp.up_proj": {
301
+ "group_size": 64,
302
+ "bits": 8
303
+ },
304
+ "language_model.model.layers.20.mlp.gate_proj": {
305
+ "group_size": 64,
306
+ "bits": 8
307
+ },
308
+ "language_model.model.layers.20.mlp.down_proj": {
309
+ "group_size": 64,
310
+ "bits": 8
311
+ },
312
+ "language_model.model.layers.20.mlp.up_proj": {
313
+ "group_size": 64,
314
+ "bits": 8
315
+ },
316
+ "language_model.model.layers.21.mlp.gate_proj": {
317
+ "group_size": 64,
318
+ "bits": 8
319
+ },
320
+ "language_model.model.layers.21.mlp.down_proj": {
321
+ "group_size": 64,
322
+ "bits": 8
323
+ },
324
+ "language_model.model.layers.21.mlp.up_proj": {
325
+ "group_size": 64,
326
+ "bits": 8
327
+ },
328
+ "language_model.model.layers.22.mlp.gate_proj": {
329
+ "group_size": 64,
330
+ "bits": 8
331
+ },
332
+ "language_model.model.layers.22.mlp.down_proj": {
333
+ "group_size": 64,
334
+ "bits": 8
335
+ },
336
+ "language_model.model.layers.22.mlp.up_proj": {
337
+ "group_size": 64,
338
+ "bits": 8
339
+ },
340
+ "language_model.model.layers.23.mlp.gate_proj": {
341
+ "group_size": 64,
342
+ "bits": 8
343
+ },
344
+ "language_model.model.layers.23.mlp.down_proj": {
345
+ "group_size": 64,
346
+ "bits": 8
347
+ },
348
+ "language_model.model.layers.23.mlp.up_proj": {
349
+ "group_size": 64,
350
+ "bits": 8
351
+ },
352
+ "language_model.model.layers.24.mlp.gate_proj": {
353
+ "group_size": 64,
354
+ "bits": 8
355
+ },
356
+ "language_model.model.layers.24.mlp.down_proj": {
357
+ "group_size": 64,
358
+ "bits": 8
359
+ },
360
+ "language_model.model.layers.24.mlp.up_proj": {
361
+ "group_size": 64,
362
+ "bits": 8
363
+ },
364
+ "language_model.model.layers.25.mlp.gate_proj": {
365
+ "group_size": 64,
366
+ "bits": 8
367
+ },
368
+ "language_model.model.layers.25.mlp.down_proj": {
369
+ "group_size": 64,
370
+ "bits": 8
371
+ },
372
+ "language_model.model.layers.25.mlp.up_proj": {
373
+ "group_size": 64,
374
+ "bits": 8
375
+ },
376
+ "language_model.model.layers.26.mlp.gate_proj": {
377
+ "group_size": 64,
378
+ "bits": 8
379
+ },
380
+ "language_model.model.layers.26.mlp.down_proj": {
381
+ "group_size": 64,
382
+ "bits": 8
383
+ },
384
+ "language_model.model.layers.26.mlp.up_proj": {
385
+ "group_size": 64,
386
+ "bits": 8
387
+ },
388
+ "language_model.model.layers.27.mlp.gate_proj": {
389
+ "group_size": 64,
390
+ "bits": 8
391
+ },
392
+ "language_model.model.layers.27.mlp.down_proj": {
393
+ "group_size": 64,
394
+ "bits": 8
395
+ },
396
+ "language_model.model.layers.27.mlp.up_proj": {
397
+ "group_size": 64,
398
+ "bits": 8
399
+ },
400
+ "language_model.model.layers.28.mlp.gate_proj": {
401
+ "group_size": 64,
402
+ "bits": 8
403
+ },
404
+ "language_model.model.layers.28.mlp.down_proj": {
405
+ "group_size": 64,
406
+ "bits": 8
407
+ },
408
+ "language_model.model.layers.28.mlp.up_proj": {
409
+ "group_size": 64,
410
+ "bits": 8
411
+ },
412
+ "language_model.model.layers.29.mlp.gate_proj": {
413
+ "group_size": 64,
414
+ "bits": 8
415
+ },
416
+ "language_model.model.layers.29.mlp.down_proj": {
417
+ "group_size": 64,
418
+ "bits": 8
419
+ },
420
+ "language_model.model.layers.29.mlp.up_proj": {
421
+ "group_size": 64,
422
+ "bits": 8
423
+ },
424
+ "language_model.model.layers.30.mlp.gate_proj": {
425
+ "group_size": 64,
426
+ "bits": 8
427
+ },
428
+ "language_model.model.layers.30.mlp.down_proj": {
429
+ "group_size": 64,
430
+ "bits": 8
431
+ },
432
+ "language_model.model.layers.30.mlp.up_proj": {
433
+ "group_size": 64,
434
+ "bits": 8
435
+ },
436
+ "language_model.model.layers.31.mlp.gate_proj": {
437
+ "group_size": 64,
438
+ "bits": 8
439
+ },
440
+ "language_model.model.layers.31.mlp.down_proj": {
441
+ "group_size": 64,
442
+ "bits": 8
443
+ },
444
+ "language_model.model.layers.31.mlp.up_proj": {
445
+ "group_size": 64,
446
+ "bits": 8
447
+ },
448
+ "language_model.model.layers.32.mlp.gate_proj": {
449
+ "group_size": 64,
450
+ "bits": 8
451
+ },
452
+ "language_model.model.layers.32.mlp.down_proj": {
453
+ "group_size": 64,
454
+ "bits": 8
455
+ },
456
+ "language_model.model.layers.32.mlp.up_proj": {
457
+ "group_size": 64,
458
+ "bits": 8
459
+ },
460
+ "language_model.model.layers.33.mlp.gate_proj": {
461
+ "group_size": 64,
462
+ "bits": 8
463
+ },
464
+ "language_model.model.layers.33.mlp.down_proj": {
465
+ "group_size": 64,
466
+ "bits": 8
467
+ },
468
+ "language_model.model.layers.33.mlp.up_proj": {
469
+ "group_size": 64,
470
+ "bits": 8
471
+ },
472
+ "language_model.model.layers.34.mlp.gate_proj": {
473
+ "group_size": 64,
474
+ "bits": 8
475
+ },
476
+ "language_model.model.layers.34.mlp.down_proj": {
477
+ "group_size": 64,
478
+ "bits": 8
479
+ },
480
+ "language_model.model.layers.34.mlp.up_proj": {
481
+ "group_size": 64,
482
+ "bits": 8
483
+ }
484
+ },
485
+ "quantization_config": {
486
+ "group_size": 64,
487
+ "bits": 4,
488
+ "mode": "affine",
489
+ "language_model.model.layers.0.mlp.gate_proj": {
490
+ "group_size": 64,
491
+ "bits": 8
492
+ },
493
+ "language_model.model.layers.0.mlp.down_proj": {
494
+ "group_size": 64,
495
+ "bits": 8
496
+ },
497
+ "language_model.model.layers.0.mlp.up_proj": {
498
+ "group_size": 64,
499
+ "bits": 8
500
+ },
501
+ "language_model.model.layers.1.mlp.gate_proj": {
502
+ "group_size": 64,
503
+ "bits": 8
504
+ },
505
+ "language_model.model.layers.1.mlp.down_proj": {
506
+ "group_size": 64,
507
+ "bits": 8
508
+ },
509
+ "language_model.model.layers.1.mlp.up_proj": {
510
+ "group_size": 64,
511
+ "bits": 8
512
+ },
513
+ "language_model.model.layers.2.mlp.gate_proj": {
514
+ "group_size": 64,
515
+ "bits": 8
516
+ },
517
+ "language_model.model.layers.2.mlp.down_proj": {
518
+ "group_size": 64,
519
+ "bits": 8
520
+ },
521
+ "language_model.model.layers.2.mlp.up_proj": {
522
+ "group_size": 64,
523
+ "bits": 8
524
+ },
525
+ "language_model.model.layers.3.mlp.gate_proj": {
526
+ "group_size": 64,
527
+ "bits": 8
528
+ },
529
+ "language_model.model.layers.3.mlp.down_proj": {
530
+ "group_size": 64,
531
+ "bits": 8
532
+ },
533
+ "language_model.model.layers.3.mlp.up_proj": {
534
+ "group_size": 64,
535
+ "bits": 8
536
+ },
537
+ "language_model.model.layers.4.mlp.gate_proj": {
538
+ "group_size": 64,
539
+ "bits": 8
540
+ },
541
+ "language_model.model.layers.4.mlp.down_proj": {
542
+ "group_size": 64,
543
+ "bits": 8
544
+ },
545
+ "language_model.model.layers.4.mlp.up_proj": {
546
+ "group_size": 64,
547
+ "bits": 8
548
+ },
549
+ "language_model.model.layers.5.mlp.gate_proj": {
550
+ "group_size": 64,
551
+ "bits": 8
552
+ },
553
+ "language_model.model.layers.5.mlp.down_proj": {
554
+ "group_size": 64,
555
+ "bits": 8
556
+ },
557
+ "language_model.model.layers.5.mlp.up_proj": {
558
+ "group_size": 64,
559
+ "bits": 8
560
+ },
561
+ "language_model.model.layers.6.mlp.gate_proj": {
562
+ "group_size": 64,
563
+ "bits": 8
564
+ },
565
+ "language_model.model.layers.6.mlp.down_proj": {
566
+ "group_size": 64,
567
+ "bits": 8
568
+ },
569
+ "language_model.model.layers.6.mlp.up_proj": {
570
+ "group_size": 64,
571
+ "bits": 8
572
+ },
573
+ "language_model.model.layers.7.mlp.gate_proj": {
574
+ "group_size": 64,
575
+ "bits": 8
576
+ },
577
+ "language_model.model.layers.7.mlp.down_proj": {
578
+ "group_size": 64,
579
+ "bits": 8
580
+ },
581
+ "language_model.model.layers.7.mlp.up_proj": {
582
+ "group_size": 64,
583
+ "bits": 8
584
+ },
585
+ "language_model.model.layers.8.mlp.gate_proj": {
586
+ "group_size": 64,
587
+ "bits": 8
588
+ },
589
+ "language_model.model.layers.8.mlp.down_proj": {
590
+ "group_size": 64,
591
+ "bits": 8
592
+ },
593
+ "language_model.model.layers.8.mlp.up_proj": {
594
+ "group_size": 64,
595
+ "bits": 8
596
+ },
597
+ "language_model.model.layers.9.mlp.gate_proj": {
598
+ "group_size": 64,
599
+ "bits": 8
600
+ },
601
+ "language_model.model.layers.9.mlp.down_proj": {
602
+ "group_size": 64,
603
+ "bits": 8
604
+ },
605
+ "language_model.model.layers.9.mlp.up_proj": {
606
+ "group_size": 64,
607
+ "bits": 8
608
+ },
609
+ "language_model.model.layers.10.mlp.gate_proj": {
610
+ "group_size": 64,
611
+ "bits": 8
612
+ },
613
+ "language_model.model.layers.10.mlp.down_proj": {
614
+ "group_size": 64,
615
+ "bits": 8
616
+ },
617
+ "language_model.model.layers.10.mlp.up_proj": {
618
+ "group_size": 64,
619
+ "bits": 8
620
+ },
621
+ "language_model.model.layers.11.mlp.gate_proj": {
622
+ "group_size": 64,
623
+ "bits": 8
624
+ },
625
+ "language_model.model.layers.11.mlp.down_proj": {
626
+ "group_size": 64,
627
+ "bits": 8
628
+ },
629
+ "language_model.model.layers.11.mlp.up_proj": {
630
+ "group_size": 64,
631
+ "bits": 8
632
+ },
633
+ "language_model.model.layers.12.mlp.gate_proj": {
634
+ "group_size": 64,
635
+ "bits": 8
636
+ },
637
+ "language_model.model.layers.12.mlp.down_proj": {
638
+ "group_size": 64,
639
+ "bits": 8
640
+ },
641
+ "language_model.model.layers.12.mlp.up_proj": {
642
+ "group_size": 64,
643
+ "bits": 8
644
+ },
645
+ "language_model.model.layers.13.mlp.gate_proj": {
646
+ "group_size": 64,
647
+ "bits": 8
648
+ },
649
+ "language_model.model.layers.13.mlp.down_proj": {
650
+ "group_size": 64,
651
+ "bits": 8
652
+ },
653
+ "language_model.model.layers.13.mlp.up_proj": {
654
+ "group_size": 64,
655
+ "bits": 8
656
+ },
657
+ "language_model.model.layers.14.mlp.gate_proj": {
658
+ "group_size": 64,
659
+ "bits": 8
660
+ },
661
+ "language_model.model.layers.14.mlp.down_proj": {
662
+ "group_size": 64,
663
+ "bits": 8
664
+ },
665
+ "language_model.model.layers.14.mlp.up_proj": {
666
+ "group_size": 64,
667
+ "bits": 8
668
+ },
669
+ "language_model.model.layers.15.mlp.gate_proj": {
670
+ "group_size": 64,
671
+ "bits": 8
672
+ },
673
+ "language_model.model.layers.15.mlp.down_proj": {
674
+ "group_size": 64,
675
+ "bits": 8
676
+ },
677
+ "language_model.model.layers.15.mlp.up_proj": {
678
+ "group_size": 64,
679
+ "bits": 8
680
+ },
681
+ "language_model.model.layers.16.mlp.gate_proj": {
682
+ "group_size": 64,
683
+ "bits": 8
684
+ },
685
+ "language_model.model.layers.16.mlp.down_proj": {
686
+ "group_size": 64,
687
+ "bits": 8
688
+ },
689
+ "language_model.model.layers.16.mlp.up_proj": {
690
+ "group_size": 64,
691
+ "bits": 8
692
+ },
693
+ "language_model.model.layers.17.mlp.gate_proj": {
694
+ "group_size": 64,
695
+ "bits": 8
696
+ },
697
+ "language_model.model.layers.17.mlp.down_proj": {
698
+ "group_size": 64,
699
+ "bits": 8
700
+ },
701
+ "language_model.model.layers.17.mlp.up_proj": {
702
+ "group_size": 64,
703
+ "bits": 8
704
+ },
705
+ "language_model.model.layers.18.mlp.gate_proj": {
706
+ "group_size": 64,
707
+ "bits": 8
708
+ },
709
+ "language_model.model.layers.18.mlp.down_proj": {
710
+ "group_size": 64,
711
+ "bits": 8
712
+ },
713
+ "language_model.model.layers.18.mlp.up_proj": {
714
+ "group_size": 64,
715
+ "bits": 8
716
+ },
717
+ "language_model.model.layers.19.mlp.gate_proj": {
718
+ "group_size": 64,
719
+ "bits": 8
720
+ },
721
+ "language_model.model.layers.19.mlp.down_proj": {
722
+ "group_size": 64,
723
+ "bits": 8
724
+ },
725
+ "language_model.model.layers.19.mlp.up_proj": {
726
+ "group_size": 64,
727
+ "bits": 8
728
+ },
729
+ "language_model.model.layers.20.mlp.gate_proj": {
730
+ "group_size": 64,
731
+ "bits": 8
732
+ },
733
+ "language_model.model.layers.20.mlp.down_proj": {
734
+ "group_size": 64,
735
+ "bits": 8
736
+ },
737
+ "language_model.model.layers.20.mlp.up_proj": {
738
+ "group_size": 64,
739
+ "bits": 8
740
+ },
741
+ "language_model.model.layers.21.mlp.gate_proj": {
742
+ "group_size": 64,
743
+ "bits": 8
744
+ },
745
+ "language_model.model.layers.21.mlp.down_proj": {
746
+ "group_size": 64,
747
+ "bits": 8
748
+ },
749
+ "language_model.model.layers.21.mlp.up_proj": {
750
+ "group_size": 64,
751
+ "bits": 8
752
+ },
753
+ "language_model.model.layers.22.mlp.gate_proj": {
754
+ "group_size": 64,
755
+ "bits": 8
756
+ },
757
+ "language_model.model.layers.22.mlp.down_proj": {
758
+ "group_size": 64,
759
+ "bits": 8
760
+ },
761
+ "language_model.model.layers.22.mlp.up_proj": {
762
+ "group_size": 64,
763
+ "bits": 8
764
+ },
765
+ "language_model.model.layers.23.mlp.gate_proj": {
766
+ "group_size": 64,
767
+ "bits": 8
768
+ },
769
+ "language_model.model.layers.23.mlp.down_proj": {
770
+ "group_size": 64,
771
+ "bits": 8
772
+ },
773
+ "language_model.model.layers.23.mlp.up_proj": {
774
+ "group_size": 64,
775
+ "bits": 8
776
+ },
777
+ "language_model.model.layers.24.mlp.gate_proj": {
778
+ "group_size": 64,
779
+ "bits": 8
780
+ },
781
+ "language_model.model.layers.24.mlp.down_proj": {
782
+ "group_size": 64,
783
+ "bits": 8
784
+ },
785
+ "language_model.model.layers.24.mlp.up_proj": {
786
+ "group_size": 64,
787
+ "bits": 8
788
+ },
789
+ "language_model.model.layers.25.mlp.gate_proj": {
790
+ "group_size": 64,
791
+ "bits": 8
792
+ },
793
+ "language_model.model.layers.25.mlp.down_proj": {
794
+ "group_size": 64,
795
+ "bits": 8
796
+ },
797
+ "language_model.model.layers.25.mlp.up_proj": {
798
+ "group_size": 64,
799
+ "bits": 8
800
+ },
801
+ "language_model.model.layers.26.mlp.gate_proj": {
802
+ "group_size": 64,
803
+ "bits": 8
804
+ },
805
+ "language_model.model.layers.26.mlp.down_proj": {
806
+ "group_size": 64,
807
+ "bits": 8
808
+ },
809
+ "language_model.model.layers.26.mlp.up_proj": {
810
+ "group_size": 64,
811
+ "bits": 8
812
+ },
813
+ "language_model.model.layers.27.mlp.gate_proj": {
814
+ "group_size": 64,
815
+ "bits": 8
816
+ },
817
+ "language_model.model.layers.27.mlp.down_proj": {
818
+ "group_size": 64,
819
+ "bits": 8
820
+ },
821
+ "language_model.model.layers.27.mlp.up_proj": {
822
+ "group_size": 64,
823
+ "bits": 8
824
+ },
825
+ "language_model.model.layers.28.mlp.gate_proj": {
826
+ "group_size": 64,
827
+ "bits": 8
828
+ },
829
+ "language_model.model.layers.28.mlp.down_proj": {
830
+ "group_size": 64,
831
+ "bits": 8
832
+ },
833
+ "language_model.model.layers.28.mlp.up_proj": {
834
+ "group_size": 64,
835
+ "bits": 8
836
+ },
837
+ "language_model.model.layers.29.mlp.gate_proj": {
838
+ "group_size": 64,
839
+ "bits": 8
840
+ },
841
+ "language_model.model.layers.29.mlp.down_proj": {
842
+ "group_size": 64,
843
+ "bits": 8
844
+ },
845
+ "language_model.model.layers.29.mlp.up_proj": {
846
+ "group_size": 64,
847
+ "bits": 8
848
+ },
849
+ "language_model.model.layers.30.mlp.gate_proj": {
850
+ "group_size": 64,
851
+ "bits": 8
852
+ },
853
+ "language_model.model.layers.30.mlp.down_proj": {
854
+ "group_size": 64,
855
+ "bits": 8
856
+ },
857
+ "language_model.model.layers.30.mlp.up_proj": {
858
+ "group_size": 64,
859
+ "bits": 8
860
+ },
861
+ "language_model.model.layers.31.mlp.gate_proj": {
862
+ "group_size": 64,
863
+ "bits": 8
864
+ },
865
+ "language_model.model.layers.31.mlp.down_proj": {
866
+ "group_size": 64,
867
+ "bits": 8
868
+ },
869
+ "language_model.model.layers.31.mlp.up_proj": {
870
+ "group_size": 64,
871
+ "bits": 8
872
+ },
873
+ "language_model.model.layers.32.mlp.gate_proj": {
874
+ "group_size": 64,
875
+ "bits": 8
876
+ },
877
+ "language_model.model.layers.32.mlp.down_proj": {
878
+ "group_size": 64,
879
+ "bits": 8
880
+ },
881
+ "language_model.model.layers.32.mlp.up_proj": {
882
+ "group_size": 64,
883
+ "bits": 8
884
+ },
885
+ "language_model.model.layers.33.mlp.gate_proj": {
886
+ "group_size": 64,
887
+ "bits": 8
888
+ },
889
+ "language_model.model.layers.33.mlp.down_proj": {
890
+ "group_size": 64,
891
+ "bits": 8
892
+ },
893
+ "language_model.model.layers.33.mlp.up_proj": {
894
+ "group_size": 64,
895
+ "bits": 8
896
+ },
897
+ "language_model.model.layers.34.mlp.gate_proj": {
898
+ "group_size": 64,
899
+ "bits": 8
900
+ },
901
+ "language_model.model.layers.34.mlp.down_proj": {
902
+ "group_size": 64,
903
+ "bits": 8
904
+ },
905
+ "language_model.model.layers.34.mlp.up_proj": {
906
+ "group_size": 64,
907
+ "bits": 8
908
+ }
909
+ },
910
+ "text_config": {
911
+ "attention_bias": false,
912
+ "attention_dropout": 0.0,
913
+ "attention_k_eq_v": false,
914
+ "bos_token_id": 2,
915
+ "dtype": "bfloat16",
916
+ "enable_moe_block": false,
917
+ "eos_token_id": 1,
918
+ "final_logit_softcapping": 30.0,
919
+ "global_head_dim": 512,
920
+ "head_dim": 256,
921
+ "hidden_activation": "gelu_pytorch_tanh",
922
+ "hidden_size": 1536,
923
+ "hidden_size_per_layer_input": 256,
924
+ "initializer_range": 0.02,
925
+ "intermediate_size": 6144,
926
+ "layer_types": [
927
+ "sliding_attention",
928
+ "sliding_attention",
929
+ "sliding_attention",
930
+ "sliding_attention",
931
+ "full_attention",
932
+ "sliding_attention",
933
+ "sliding_attention",
934
+ "sliding_attention",
935
+ "sliding_attention",
936
+ "full_attention",
937
+ "sliding_attention",
938
+ "sliding_attention",
939
+ "sliding_attention",
940
+ "sliding_attention",
941
+ "full_attention",
942
+ "sliding_attention",
943
+ "sliding_attention",
944
+ "sliding_attention",
945
+ "sliding_attention",
946
+ "full_attention",
947
+ "sliding_attention",
948
+ "sliding_attention",
949
+ "sliding_attention",
950
+ "sliding_attention",
951
+ "full_attention",
952
+ "sliding_attention",
953
+ "sliding_attention",
954
+ "sliding_attention",
955
+ "sliding_attention",
956
+ "full_attention",
957
+ "sliding_attention",
958
+ "sliding_attention",
959
+ "sliding_attention",
960
+ "sliding_attention",
961
+ "full_attention"
962
+ ],
963
+ "max_position_embeddings": 131072,
964
+ "model_type": "gemma4_text",
965
+ "moe_intermediate_size": null,
966
+ "num_attention_heads": 8,
967
+ "num_experts": null,
968
+ "num_global_key_value_heads": null,
969
+ "num_hidden_layers": 35,
970
+ "num_key_value_heads": 1,
971
+ "num_kv_shared_layers": 20,
972
+ "pad_token_id": 0,
973
+ "rms_norm_eps": 1e-06,
974
+ "rope_parameters": {
975
+ "full_attention": {
976
+ "partial_rotary_factor": 0.25,
977
+ "rope_theta": 1000000.0,
978
+ "rope_type": "proportional"
979
+ },
980
+ "sliding_attention": {
981
+ "rope_theta": 10000.0,
982
+ "rope_type": "default"
983
+ }
984
+ },
985
+ "sliding_window": 512,
986
+ "tie_word_embeddings": true,
987
+ "top_k_experts": null,
988
+ "use_bidirectional_attention": null,
989
+ "use_cache": true,
990
+ "use_double_wide_mlp": true,
991
+ "vocab_size": 262144,
992
+ "vocab_size_per_layer_input": 262144
993
+ },
994
+ "tie_word_embeddings": true,
995
+ "transformers_version": "5.6.2",
996
+ "video_token_id": 258884,
997
+ "vision_config": {
998
+ "_name_or_path": "",
999
+ "architectures": null,
1000
+ "attention_bias": false,
1001
+ "attention_dropout": 0.0,
1002
+ "chunk_size_feed_forward": 0,
1003
+ "default_output_length": 280,
1004
+ "dtype": "bfloat16",
1005
+ "global_head_dim": 64,
1006
+ "head_dim": 64,
1007
+ "hidden_activation": "gelu_pytorch_tanh",
1008
+ "hidden_size": 768,
1009
+ "id2label": {
1010
+ "0": "LABEL_0",
1011
+ "1": "LABEL_1"
1012
+ },
1013
+ "initializer_range": 0.02,
1014
+ "intermediate_size": 3072,
1015
+ "is_encoder_decoder": false,
1016
+ "label2id": {
1017
+ "LABEL_0": 0,
1018
+ "LABEL_1": 1
1019
+ },
1020
+ "max_position_embeddings": 131072,
1021
+ "model_type": "gemma4_vision",
1022
+ "num_attention_heads": 12,
1023
+ "num_hidden_layers": 16,
1024
+ "num_key_value_heads": 12,
1025
+ "output_attentions": false,
1026
+ "output_hidden_states": false,
1027
+ "patch_size": 16,
1028
+ "pooling_kernel_size": 3,
1029
+ "position_embedding_size": 10240,
1030
+ "problem_type": null,
1031
+ "return_dict": true,
1032
+ "rms_norm_eps": 1e-06,
1033
+ "rope_parameters": {
1034
+ "rope_theta": 100.0,
1035
+ "rope_type": "default"
1036
+ },
1037
+ "standardize": false,
1038
+ "use_clipped_linears": true
1039
+ },
1040
+ "vision_soft_tokens_per_image": 280
1041
+ }
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
+ 106,
7
+ 50
8
+ ],
9
+ "pad_token_id": 0,
10
+ "temperature": 1.0,
11
+ "top_k": 64,
12
+ "top_p": 0.95,
13
+ "transformers_version": "5.6.2"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8247a4828d9e2603c2dd7cc86d662377dbc54f35530982038f604a900ec95aad
3
+ size 3719496017
processor_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_seq_length": 750,
3
+ "image_processor": {
4
+ "do_convert_rgb": true,
5
+ "do_normalize": false,
6
+ "do_rescale": true,
7
+ "do_resize": true,
8
+ "image_mean": [
9
+ 0.0,
10
+ 0.0,
11
+ 0.0
12
+ ],
13
+ "image_processor_type": "Gemma4ImageProcessor",
14
+ "image_seq_length": 280,
15
+ "image_std": [
16
+ 1.0,
17
+ 1.0,
18
+ 1.0
19
+ ],
20
+ "max_soft_tokens": 280,
21
+ "patch_size": 16,
22
+ "pooling_kernel_size": 3,
23
+ "resample": 3,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "height": 224,
27
+ "width": 224
28
+ }
29
+ },
30
+ "image_seq_length": 280,
31
+ "processor_class": "Gemma4Processor",
32
+ "feature_extractor": {
33
+ "feature_extractor_type": "Gemma4AudioFeatureExtractor",
34
+ "sampling_rate": 16000,
35
+ "num_mel_filters": 128,
36
+ "fft_length": 512,
37
+ "hop_length": 160,
38
+ "chunk_duration": 8.0,
39
+ "overlap_duration": 1.0
40
+ },
41
+ "audio_ms_per_token": 40
42
+ }
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,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
22
+ "mask_token": "<mask>",
23
+ "model_max_length": 1000000000000000019884624838656,
24
+ "model_specific_special_tokens": {
25
+ "audio_token": "<|audio|>",
26
+ "boa_token": "<|audio>",
27
+ "boi_token": "<|image>",
28
+ "eoa_token": "<audio|>",
29
+ "eoc_token": "<channel|>",
30
+ "eoi_token": "<image|>",
31
+ "eot_token": "<turn|>",
32
+ "escape_token": "<|\"|>",
33
+ "etc_token": "<tool_call|>",
34
+ "etd_token": "<tool|>",
35
+ "etr_token": "<tool_response|>",
36
+ "image_token": "<|image|>",
37
+ "soc_token": "<|channel>",
38
+ "sot_token": "<|turn>",
39
+ "stc_token": "<|tool_call>",
40
+ "std_token": "<|tool>",
41
+ "str_token": "<|tool_response>",
42
+ "think_token": "<|think|>"
43
+ },
44
+ "pad_token": "<pad>",
45
+ "padding_side": "left",
46
+ "processor_class": "Gemma4Processor",
47
+ "response_schema": {
48
+ "properties": {
49
+ "content": {
50
+ "type": "string"
51
+ },
52
+ "role": {
53
+ "const": "assistant"
54
+ },
55
+ "thinking": {
56
+ "type": "string"
57
+ },
58
+ "tool_calls": {
59
+ "items": {
60
+ "properties": {
61
+ "function": {
62
+ "properties": {
63
+ "arguments": {
64
+ "additionalProperties": {},
65
+ "type": "object",
66
+ "x-parser": "gemma4-tool-call"
67
+ },
68
+ "name": {
69
+ "type": "string"
70
+ }
71
+ },
72
+ "type": "object",
73
+ "x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
74
+ },
75
+ "type": {
76
+ "const": "function"
77
+ }
78
+ },
79
+ "type": "object"
80
+ },
81
+ "type": "array",
82
+ "x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
83
+ }
84
+ },
85
+ "type": "object",
86
+ "x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
87
+ },
88
+ "soc_token": "<|channel>",
89
+ "sot_token": "<|turn>",
90
+ "stc_token": "<|tool_call>",
91
+ "std_token": "<|tool>",
92
+ "str_token": "<|tool_response>",
93
+ "think_token": "<|think|>",
94
+ "tokenizer_class": "GemmaTokenizer",
95
+ "unk_token": "<unk>"
96
+ }