Xenova HF Staff commited on
Commit
7b305a5
·
verified ·
1 Parent(s): 9a3ac79

Upload Gemma3nForConditionalGeneration

Browse files
Files changed (4) hide show
  1. README.md +199 -0
  2. config.json +285 -0
  3. generation_config.json +14 -0
  4. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
config.json ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma3nForConditionalGeneration"
4
+ ],
5
+ "audio_config": {
6
+ "conf_attention_chunk_size": 12,
7
+ "conf_attention_context_left": 13,
8
+ "conf_attention_context_right": 0,
9
+ "conf_attention_logit_cap": 50.0,
10
+ "conf_conv_kernel_size": 5,
11
+ "conf_num_attention_heads": 2,
12
+ "conf_num_hidden_layers": 2,
13
+ "conf_reduction_factor": 4,
14
+ "conf_residual_weight": 0.5,
15
+ "gradient_clipping": 10000000000.0,
16
+ "hidden_size": 64,
17
+ "input_feat_size": 128,
18
+ "model_type": "gemma3n_audio",
19
+ "rms_norm_eps": 1e-06,
20
+ "sscp_conv_channel_size": [
21
+ 128,
22
+ 32
23
+ ],
24
+ "sscp_conv_group_norm_eps": 0.001,
25
+ "sscp_conv_kernel_size": [
26
+ [
27
+ 3,
28
+ 3
29
+ ],
30
+ [
31
+ 3,
32
+ 3
33
+ ]
34
+ ],
35
+ "sscp_conv_stride_size": [
36
+ [
37
+ 2,
38
+ 2
39
+ ],
40
+ [
41
+ 2,
42
+ 2
43
+ ]
44
+ ],
45
+ "torch_dtype": "bfloat16",
46
+ "vocab_offset": 262272,
47
+ "vocab_size": 128
48
+ },
49
+ "audio_soft_tokens_per_image": 188,
50
+ "audio_token_id": 262273,
51
+ "boa_token_id": 256000,
52
+ "boi_token_id": 255999,
53
+ "eoa_token_id": 262272,
54
+ "eoi_token_id": 262144,
55
+ "eos_token_id": [
56
+ 1,
57
+ 106
58
+ ],
59
+ "image_token_id": 262145,
60
+ "initializer_range": 0.02,
61
+ "model_type": "gemma3n",
62
+ "text_config": {
63
+ "activation_sparsity_pattern": [
64
+ 0.95,
65
+ 0.95,
66
+ 0.0,
67
+ 0.0
68
+ ],
69
+ "altup_active_idx": 0,
70
+ "altup_coef_clip": 120.0,
71
+ "altup_correct_scale": true,
72
+ "altup_num_inputs": 4,
73
+ "attention_bias": false,
74
+ "attention_dropout": 0.0,
75
+ "final_logit_softcapping": 30.0,
76
+ "head_dim": 32,
77
+ "hidden_activation": "gelu_pytorch_tanh",
78
+ "hidden_size": 32,
79
+ "hidden_size_per_layer_input": 2,
80
+ "initializer_range": 0.02,
81
+ "intermediate_size": [
82
+ 64,
83
+ 64,
84
+ 64,
85
+ 64
86
+ ],
87
+ "laurel_rank": 8,
88
+ "layer_types": [
89
+ "sliding_attention",
90
+ "full_attention",
91
+ "sliding_attention",
92
+ "full_attention"
93
+ ],
94
+ "max_position_embeddings": 32768,
95
+ "model_type": "gemma3n_text",
96
+ "num_attention_heads": 1,
97
+ "num_hidden_layers": 4,
98
+ "num_key_value_heads": 1,
99
+ "num_kv_shared_layers": 2,
100
+ "rms_norm_eps": 1e-06,
101
+ "rope_local_base_freq": 10000.0,
102
+ "rope_scaling": null,
103
+ "rope_theta": 1000000.0,
104
+ "sliding_window": 512,
105
+ "torch_dtype": "bfloat16",
106
+ "use_cache": true,
107
+ "vocab_size": 262400,
108
+ "vocab_size_per_layer_input": 262144
109
+ },
110
+ "torch_dtype": "bfloat16",
111
+ "transformers_version": "4.53.2",
112
+ "vision_config": {
113
+ "architecture": "mobilenetv5_300m_enc",
114
+ "do_pooling": false,
115
+ "hidden_size": 2048,
116
+ "initializer_range": 0.02,
117
+ "label_names": [
118
+ "LABEL_0",
119
+ "LABEL_1"
120
+ ],
121
+ "model_args": {
122
+ "block_args": [
123
+ [
124
+ {
125
+ "act_layer": null,
126
+ "block_type": "er",
127
+ "exp_kernel_size": 3,
128
+ "exp_ratio": 4.0,
129
+ "force_in_chs": 0,
130
+ "noskip": false,
131
+ "out_chs": 32,
132
+ "pw_kernel_size": 1,
133
+ "se_ratio": 0.0,
134
+ "stride": 2
135
+ },
136
+ {
137
+ "act_layer": null,
138
+ "block_type": "er",
139
+ "exp_kernel_size": 3,
140
+ "exp_ratio": 4.0,
141
+ "force_in_chs": 0,
142
+ "noskip": false,
143
+ "out_chs": 32,
144
+ "pw_kernel_size": 1,
145
+ "se_ratio": 0.0,
146
+ "stride": 1
147
+ }
148
+ ],
149
+ [
150
+ {
151
+ "act_layer": null,
152
+ "block_type": "uir",
153
+ "dw_kernel_size_end": 0,
154
+ "dw_kernel_size_mid": 5,
155
+ "dw_kernel_size_start": 3,
156
+ "exp_ratio": 6.0,
157
+ "noskip": false,
158
+ "out_chs": 32,
159
+ "se_ratio": 0.0,
160
+ "stride": 2
161
+ },
162
+ {
163
+ "act_layer": null,
164
+ "block_type": "uir",
165
+ "dw_kernel_size_end": 0,
166
+ "dw_kernel_size_mid": 0,
167
+ "dw_kernel_size_start": 5,
168
+ "exp_ratio": 4.0,
169
+ "noskip": false,
170
+ "out_chs": 32,
171
+ "se_ratio": 0.0,
172
+ "stride": 1
173
+ },
174
+ {
175
+ "act_layer": null,
176
+ "block_type": "uir",
177
+ "dw_kernel_size_end": 0,
178
+ "dw_kernel_size_mid": 0,
179
+ "dw_kernel_size_start": 3,
180
+ "exp_ratio": 4.0,
181
+ "noskip": false,
182
+ "out_chs": 32,
183
+ "se_ratio": 0.0,
184
+ "stride": 1
185
+ }
186
+ ],
187
+ [
188
+ {
189
+ "act_layer": null,
190
+ "block_type": "uir",
191
+ "dw_kernel_size_end": 0,
192
+ "dw_kernel_size_mid": 5,
193
+ "dw_kernel_size_start": 5,
194
+ "exp_ratio": 6.0,
195
+ "noskip": false,
196
+ "out_chs": 32,
197
+ "se_ratio": 0.0,
198
+ "stride": 2
199
+ },
200
+ {
201
+ "act_layer": null,
202
+ "block_type": "uir",
203
+ "dw_kernel_size_end": 0,
204
+ "dw_kernel_size_mid": 0,
205
+ "dw_kernel_size_start": 0,
206
+ "exp_ratio": 1.0,
207
+ "noskip": false,
208
+ "out_chs": 32,
209
+ "se_ratio": 0.0,
210
+ "stride": 1
211
+ },
212
+ {
213
+ "act_layer": null,
214
+ "block_type": "mqa",
215
+ "dw_kernel_size": 3,
216
+ "key_dim": 64,
217
+ "kv_stride": 2,
218
+ "noskip": false,
219
+ "num_heads": 2,
220
+ "out_chs": 32,
221
+ "stride": 1,
222
+ "value_dim": 64
223
+ },
224
+ {
225
+ "act_layer": null,
226
+ "block_type": "uir",
227
+ "dw_kernel_size_end": 0,
228
+ "dw_kernel_size_mid": 0,
229
+ "dw_kernel_size_start": 0,
230
+ "exp_ratio": 2.0,
231
+ "noskip": false,
232
+ "out_chs": 32,
233
+ "se_ratio": 0.0,
234
+ "stride": 1
235
+ }
236
+ ],
237
+ [
238
+ {
239
+ "act_layer": null,
240
+ "block_type": "uir",
241
+ "dw_kernel_size_end": 0,
242
+ "dw_kernel_size_mid": 5,
243
+ "dw_kernel_size_start": 5,
244
+ "exp_ratio": 6.0,
245
+ "noskip": false,
246
+ "out_chs": 32,
247
+ "se_ratio": 0.0,
248
+ "stride": 2
249
+ },
250
+ {
251
+ "act_layer": null,
252
+ "block_type": "mqa",
253
+ "dw_kernel_size": 3,
254
+ "key_dim": 64,
255
+ "kv_stride": 1,
256
+ "noskip": false,
257
+ "num_heads": 2,
258
+ "out_chs": 32,
259
+ "stride": 1,
260
+ "value_dim": 64
261
+ },
262
+ {
263
+ "act_layer": null,
264
+ "block_type": "uir",
265
+ "dw_kernel_size_end": 0,
266
+ "dw_kernel_size_mid": 0,
267
+ "dw_kernel_size_start": 0,
268
+ "exp_ratio": 2.0,
269
+ "noskip": false,
270
+ "out_chs": 32,
271
+ "se_ratio": 0.0,
272
+ "stride": 1
273
+ }
274
+ ]
275
+ ]
276
+ },
277
+ "model_type": "gemma3n_vision",
278
+ "num_classes": 2,
279
+ "rms_norm_eps": 1e-06,
280
+ "torch_dtype": "bfloat16",
281
+ "vocab_offset": 262144,
282
+ "vocab_size": 128
283
+ },
284
+ "vision_soft_tokens_per_image": 256
285
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 1,
7
+ 106
8
+ ],
9
+ "pad_token_id": 0,
10
+ "top_k": 64,
11
+ "top_p": 0.95,
12
+ "transformers_version": "4.53.2",
13
+ "trust_remote_code": true
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07cf4ccabeb400baa5b96ad6df316bb7ff86578f9450bf5b1e2a226e15c448f5
3
+ size 23576116