mymonkeyman commited on
Commit
e2867be
·
verified ·
1 Parent(s): e29d8c7

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ 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
37
+ model.safetensors filter=lfs diff=lfs merge=lfs -text
38
+ tokenizer.model filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,536 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: google/gemma-3-1b-pt
3
+ library_name: transformers
4
+ license: gemma
5
+ pipeline_tag: text-generation
6
+ extra_gated_heading: Access Gemma on Hugging Face
7
+ extra_gated_prompt: To access Gemma on Hugging Face, you’re required to review and
8
+ agree to Google’s usage license. To do this, please ensure you’re logged in to Hugging
9
+ Face and click below. Requests are processed immediately.
10
+ extra_gated_button_content: Acknowledge license
11
+ ---
12
+ # gemma-3-1b-it-RK3588-1.1.4
13
+
14
+ This version of gemma-3-1b-it has been converted to run on the RK3588 NPU using w8a8_g128 quantization.
15
+
16
+ This model has been optimized with the following LoRA:
17
+
18
+ Compatible with RKLLM version: 1.1.4
19
+
20
+ ## Useful links:
21
+ [Official RKLLM GitHub](https://github.com/airockchip/rknn-llm)
22
+
23
+ [RockhipNPU Reddit](https://reddit.com/r/RockchipNPU)
24
+
25
+ [EZRKNN-LLM](https://github.com/Pelochus/ezrknn-llm/)
26
+
27
+ Pretty much anything by these folks: [marty1885](https://github.com/marty1885) and [happyme531](https://huggingface.co/happyme531)
28
+
29
+ Converted using https://github.com/c0zaut/ez-er-rkllm-toolkit
30
+
31
+ # Original Model Card for base model, gemma-3-1b-it, below:
32
+
33
+
34
+ # Gemma 3 model card
35
+
36
+ **Model Page**: [Gemma](https://ai.google.dev/gemma/docs/core)
37
+
38
+ **Resources and Technical Documentation**:
39
+
40
+ * [Gemma 3 Technical Report][g3-tech-report]
41
+ * [Responsible Generative AI Toolkit][rai-toolkit]
42
+ * [Gemma on Kaggle][kaggle-gemma]
43
+ * [Gemma on Vertex Model Garden][vertex-mg-gemma3]
44
+
45
+ **Terms of Use**: [Terms][terms]
46
+
47
+ **Authors**: Google DeepMind
48
+
49
+ ## Model Information
50
+
51
+ Summary description and brief definition of inputs and outputs.
52
+
53
+ ### Description
54
+
55
+ Gemma is a family of lightweight, state-of-the-art open models from Google,
56
+ built from the same research and technology used to create the Gemini models.
57
+ Gemma 3 models are multimodal, handling text and image input and generating text
58
+ output, with open weights for both pre-trained variants and instruction-tuned
59
+ variants. Gemma 3 has a large, 128K context window, multilingual support in over
60
+ 140 languages, and is available in more sizes than previous versions. Gemma 3
61
+ models are well-suited for a variety of text generation and image understanding
62
+ tasks, including question answering, summarization, and reasoning. Their
63
+ relatively small size makes it possible to deploy them in environments with
64
+ limited resources such as laptops, desktops or your own cloud infrastructure,
65
+ democratizing access to state of the art AI models and helping foster innovation
66
+ for everyone.
67
+
68
+ ### Inputs and outputs
69
+
70
+ - **Input:**
71
+ - Text string, such as a question, a prompt, or a document to be summarized
72
+ - Images, normalized to 896 x 896 resolution and encoded to 256 tokens
73
+ each
74
+ - Total input context of 128K tokens for the 4B, 12B, and 27B sizes, and
75
+ 32K tokens for the 1B size
76
+
77
+ - **Output:**
78
+ - Generated text in response to the input, such as an answer to a
79
+ question, analysis of image content, or a summary of a document
80
+ - Total output context of 8192 tokens
81
+
82
+ ### Usage
83
+
84
+ Below, there are some code snippets on how to get quickly started with running the model. First, install the Transformers library with the version made for Gemma 3:
85
+
86
+ ```sh
87
+
88
+ $ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3
89
+
90
+ ```
91
+
92
+ Then, copy the snippet from the section that is relevant for your use case.
93
+
94
+ #### Running with the `pipeline` API
95
+
96
+ With instruction-tuned models, you need to use chat templates to process our inputs first. Then, you can pass it to the pipeline.
97
+
98
+ ```python
99
+ from transformers import pipeline
100
+
101
+ pipe = pipeline("text-generation", model="google/gemma-3-1b-it", device="cuda", torch_dtype=torch.bfloat16)
102
+
103
+ messages = [
104
+ [
105
+ {
106
+ "role": "system",
107
+ "content": [{"type": "text", "text": "You are a helpful assistant."},]
108
+ },
109
+ {
110
+ "role": "user",
111
+ "content": [{"type": "text", "text": "Write a poem on Hugging Face, the company"},]
112
+ },
113
+ ],
114
+ ]
115
+
116
+ output = pipe(messages, max_new_tokens=50)
117
+ ```
118
+
119
+ #### Running the model on a single / multi GPU
120
+
121
+ ```python
122
+ from transformers import AutoTokenizer, BitsAndBytesConfig, Gemma3ForCausalLM
123
+ import torch
124
+
125
+ model_id = "google/gemma-3-1b-it"
126
+
127
+ quantization_config = BitsAndBytesConfig(load_in_8bit=True)
128
+
129
+ model = Gemma3ForCausalLM.from_pretrained(
130
+ model_id, quantization_config=quantization_config
131
+ ).eval()
132
+
133
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
134
+
135
+ messages = [
136
+ [
137
+ {
138
+ "role": "system",
139
+ "content": [{"type": "text", "text": "You are a helpful assistant."},]
140
+ },
141
+ {
142
+ "role": "user",
143
+ "content": [{"type": "text", "text": "Write a poem on Hugging Face, the company"},]
144
+ },
145
+ ],
146
+ ]
147
+ inputs = tokenizer.apply_chat_template(
148
+ messages,
149
+ add_generation_prompt=True,
150
+ tokenize=True,
151
+ return_dict=True,
152
+ return_tensors="pt",
153
+ ).to(model.device).to(torch.bfloat16)
154
+
155
+
156
+ with torch.inference_mode():
157
+ outputs = model.generate(**inputs, max_new_tokens=64)
158
+
159
+ outputs = tokenizer.batch_decode(outputs)
160
+ ```
161
+
162
+
163
+ ### Citation
164
+
165
+ ```none
166
+ @article{gemma_2025,
167
+ title={Gemma 3},
168
+ url={https://goo.gle/Gemma3Report},
169
+ publisher={Kaggle},
170
+ author={Gemma Team},
171
+ year={2025}
172
+ }
173
+ ```
174
+
175
+ ## Model Data
176
+
177
+ Data used for model training and how the data was processed.
178
+
179
+ ### Training Dataset
180
+
181
+ These models were trained on a dataset of text data that includes a wide variety
182
+ of sources. The 27B model was trained with 14 trillion tokens, the 12B model was
183
+ trained with 12 trillion tokens, 4B model was trained with 4 trillion tokens and
184
+ 1B with 2 trillion tokens. Here are the key components:
185
+
186
+ - Web Documents: A diverse collection of web text ensures the model is
187
+ exposed to a broad range of linguistic styles, topics, and vocabulary. The
188
+ training dataset includes content in over 140 languages.
189
+ - Code: Exposing the model to code helps it to learn the syntax and
190
+ patterns of programming languages, which improves its ability to generate
191
+ code and understand code-related questions.
192
+ - Mathematics: Training on mathematical text helps the model learn logical
193
+ reasoning, symbolic representation, and to address mathematical queries.
194
+ - Images: A wide range of images enables the model to perform image
195
+ analysis and visual data extraction tasks.
196
+
197
+ The combination of these diverse data sources is crucial for training a powerful
198
+ multimodal model that can handle a wide variety of different tasks and data
199
+ formats.
200
+
201
+ ### Data Preprocessing
202
+
203
+ Here are the key data cleaning and filtering methods applied to the training
204
+ data:
205
+
206
+ - CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering
207
+ was applied at multiple stages in the data preparation process to ensure
208
+ the exclusion of harmful and illegal content.
209
+ - Sensitive Data Filtering: As part of making Gemma pre-trained models
210
+ safe and reliable, automated techniques were used to filter out certain
211
+ personal information and other sensitive data from training sets.
212
+ - Additional methods: Filtering based on content quality and safety in
213
+ line with [our policies][safety-policies].
214
+
215
+ ## Implementation Information
216
+
217
+ Details about the model internals.
218
+
219
+ ### Hardware
220
+
221
+ Gemma was trained using [Tensor Processing Unit (TPU)][tpu] hardware (TPUv4p,
222
+ TPUv5p and TPUv5e). Training vision-language models (VLMS) requires significant
223
+ computational power. TPUs, designed specifically for matrix operations common in
224
+ machine learning, offer several advantages in this domain:
225
+
226
+ - Performance: TPUs are specifically designed to handle the massive
227
+ computations involved in training VLMs. They can speed up training
228
+ considerably compared to CPUs.
229
+ - Memory: TPUs often come with large amounts of high-bandwidth memory,
230
+ allowing for the handling of large models and batch sizes during training.
231
+ This can lead to better model quality.
232
+ - Scalability: TPU Pods (large clusters of TPUs) provide a scalable
233
+ solution for handling the growing complexity of large foundation models.
234
+ You can distribute training across multiple TPU devices for faster and more
235
+ efficient processing.
236
+ - Cost-effectiveness: In many scenarios, TPUs can provide a more
237
+ cost-effective solution for training large models compared to CPU-based
238
+ infrastructure, especially when considering the time and resources saved
239
+ due to faster training.
240
+ - These advantages are aligned with
241
+ [Google's commitments to operate sustainably][sustainability].
242
+
243
+ ### Software
244
+
245
+ Training was done using [JAX][jax] and [ML Pathways][ml-pathways].
246
+
247
+ JAX allows researchers to take advantage of the latest generation of hardware,
248
+ including TPUs, for faster and more efficient training of large models. ML
249
+ Pathways is Google's latest effort to build artificially intelligent systems
250
+ capable of generalizing across multiple tasks. This is specially suitable for
251
+ foundation models, including large language models like these ones.
252
+
253
+ Together, JAX and ML Pathways are used as described in the
254
+ [paper about the Gemini family of models][gemini-2-paper]; *"the 'single
255
+ controller' programming model of Jax and Pathways allows a single Python
256
+ process to orchestrate the entire training run, dramatically simplifying the
257
+ development workflow."*
258
+
259
+ ## Evaluation
260
+
261
+ Model evaluation metrics and results.
262
+
263
+ ### Benchmark Results
264
+
265
+ These models were evaluated against a large collection of different datasets and
266
+ metrics to cover different aspects of text generation:
267
+
268
+ #### Reasoning and factuality
269
+
270
+ | Benchmark | Metric | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
271
+ | ------------------------------ |----------------|:--------------:|:-------------:|:--------------:|:--------------:|
272
+ | [HellaSwag][hellaswag] | 10-shot | 62.3 | 77.2 | 84.2 | 85.6 |
273
+ | [BoolQ][boolq] | 0-shot | 63.2 | 72.3 | 78.8 | 82.4 |
274
+ | [PIQA][piqa] | 0-shot | 73.8 | 79.6 | 81.8 | 83.3 |
275
+ | [SocialIQA][socialiqa] | 0-shot | 48.9 | 51.9 | 53.4 | 54.9 |
276
+ | [TriviaQA][triviaqa] | 5-shot | 39.8 | 65.8 | 78.2 | 85.5 |
277
+ | [Natural Questions][naturalq] | 5-shot | 9.48 | 20.0 | 31.4 | 36.1 |
278
+ | [ARC-c][arc] | 25-shot | 38.4 | 56.2 | 68.9 | 70.6 |
279
+ | [ARC-e][arc] | 0-shot | 73.0 | 82.4 | 88.3 | 89.0 |
280
+ | [WinoGrande][winogrande] | 5-shot | 58.2 | 64.7 | 74.3 | 78.8 |
281
+ | [BIG-Bench Hard][bbh] | few-shot | 28.4 | 50.9 | 72.6 | 77.7 |
282
+ | [DROP][drop] | 1-shot | 42.4 | 60.1 | 72.2 | 77.2 |
283
+
284
+ [hellaswag]: https://arxiv.org/abs/1905.07830
285
+ [boolq]: https://arxiv.org/abs/1905.10044
286
+ [piqa]: https://arxiv.org/abs/1911.11641
287
+ [socialiqa]: https://arxiv.org/abs/1904.09728
288
+ [triviaqa]: https://arxiv.org/abs/1705.03551
289
+ [naturalq]: https://github.com/google-research-datasets/natural-questions
290
+ [arc]: https://arxiv.org/abs/1911.01547
291
+ [winogrande]: https://arxiv.org/abs/1907.10641
292
+ [bbh]: https://paperswithcode.com/dataset/bbh
293
+ [drop]: https://arxiv.org/abs/1903.00161
294
+
295
+ #### STEM and code
296
+
297
+ | Benchmark | Metric | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
298
+ | ------------------------------ |----------------|:-------------:|:--------------:|:--------------:|
299
+ | [MMLU][mmlu] | 5-shot | 59.6 | 74.5 | 78.6 |
300
+ | [MMLU][mmlu] (Pro COT) | 5-shot | 29.2 | 45.3 | 52.2 |
301
+ | [AGIEval][agieval] | 3-5-shot | 42.1 | 57.4 | 66.2 |
302
+ | [MATH][math] | 4-shot | 24.2 | 43.3 | 50.0 |
303
+ | [GSM8K][gsm8k] | 8-shot | 38.4 | 71.0 | 82.6 |
304
+ | [GPQA][gpqa] | 5-shot | 15.0 | 25.4 | 24.3 |
305
+ | [MBPP][mbpp] | 3-shot | 46.0 | 60.4 | 65.6 |
306
+ | [HumanEval][humaneval] | 0-shot | 36.0 | 45.7 | 48.8 |
307
+
308
+ [mmlu]: https://arxiv.org/abs/2009.03300
309
+ [agieval]: https://arxiv.org/abs/2304.06364
310
+ [math]: https://arxiv.org/abs/2103.03874
311
+ [gsm8k]: https://arxiv.org/abs/2110.14168
312
+ [gpqa]: https://arxiv.org/abs/2311.12022
313
+ [mbpp]: https://arxiv.org/abs/2108.07732
314
+ [humaneval]: https://arxiv.org/abs/2107.03374
315
+
316
+ #### Multilingual
317
+
318
+ | Benchmark | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
319
+ | ------------------------------------ |:-------------:|:-------------:|:--------------:|:--------------:|
320
+ | [MGSM][mgsm] | 2.04 | 34.7 | 64.3 | 74.3 |
321
+ | [Global-MMLU-Lite][global-mmlu-lite] | 24.9 | 57.0 | 69.4 | 75.7 |
322
+ | [WMT24++][wmt24pp] (ChrF) | 36.7 | 48.4 | 53.9 | 55.7 |
323
+ | [FloRes][flores] | 29.5 | 39.2 | 46.0 | 48.8 |
324
+ | [XQuAD][xquad] (all) | 43.9 | 68.0 | 74.5 | 76.8 |
325
+ | [ECLeKTic][eclektic] | 4.69 | 11.0 | 17.2 | 24.4 |
326
+ | [IndicGenBench][indicgenbench] | 41.4 | 57.2 | 61.7 | 63.4 |
327
+
328
+ [mgsm]: https://arxiv.org/abs/2210.03057
329
+ [flores]: https://arxiv.org/abs/2106.03193
330
+ [xquad]: https://arxiv.org/abs/1910.11856v3
331
+ [global-mmlu-lite]: https://huggingface.co/datasets/CohereForAI/Global-MMLU-Lite
332
+ [wmt24pp]: https://arxiv.org/abs/2502.12404v1
333
+ [eclektic]: https://arxiv.org/abs/2502.21228
334
+ [indicgenbench]: https://arxiv.org/abs/2404.16816
335
+
336
+ #### Multimodal
337
+
338
+ | Benchmark | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
339
+ | ------------------------------ |:-------------:|:--------------:|:--------------:|
340
+ | [COCOcap][coco-cap] | 102 | 111 | 116 |
341
+ | [DocVQA][docvqa] (val) | 72.8 | 82.3 | 85.6 |
342
+ | [InfoVQA][info-vqa] (val) | 44.1 | 54.8 | 59.4 |
343
+ | [MMMU][mmmu] (pt) | 39.2 | 50.3 | 56.1 |
344
+ | [TextVQA][textvqa] (val) | 58.9 | 66.5 | 68.6 |
345
+ | [RealWorldQA][realworldqa] | 45.5 | 52.2 | 53.9 |
346
+ | [ReMI][remi] | 27.3 | 38.5 | 44.8 |
347
+ | [AI2D][ai2d] | 63.2 | 75.2 | 79.0 |
348
+ | [ChartQA][chartqa] | 63.6 | 74.7 | 76.3 |
349
+ | [VQAv2][vqav2] | 63.9 | 71.2 | 72.9 |
350
+ | [BLINK][blinkvqa] | 38.0 | 35.9 | 39.6 |
351
+ | [OKVQA][okvqa] | 51.0 | 58.7 | 60.2 |
352
+ | [TallyQA][tallyqa] | 42.5 | 51.8 | 54.3 |
353
+ | [SpatialSense VQA][ss-vqa] | 50.9 | 60.0 | 59.4 |
354
+ | [CountBenchQA][countbenchqa] | 26.1 | 17.8 | 68.0 |
355
+
356
+ [coco-cap]: https://cocodataset.org/#home
357
+ [docvqa]: https://www.docvqa.org/
358
+ [info-vqa]: https://arxiv.org/abs/2104.12756
359
+ [mmmu]: https://arxiv.org/abs/2311.16502
360
+ [textvqa]: https://textvqa.org/
361
+ [realworldqa]: https://paperswithcode.com/dataset/realworldqa
362
+ [remi]: https://arxiv.org/html/2406.09175v1
363
+ [ai2d]: https://allenai.org/data/diagrams
364
+ [chartqa]: https://arxiv.org/abs/2203.10244
365
+ [vqav2]: https://visualqa.org/index.html
366
+ [blinkvqa]: https://arxiv.org/abs/2404.12390
367
+ [okvqa]: https://okvqa.allenai.org/
368
+ [tallyqa]: https://arxiv.org/abs/1810.12440
369
+ [ss-vqa]: https://arxiv.org/abs/1908.02660
370
+ [countbenchqa]: https://github.com/google-research/big_vision/blob/main/big_vision/datasets/countbenchqa/
371
+
372
+ ## Ethics and Safety
373
+
374
+ Ethics and safety evaluation approach and results.
375
+
376
+ ### Evaluation Approach
377
+
378
+ Our evaluation methods include structured evaluations and internal red-teaming
379
+ testing of relevant content policies. Red-teaming was conducted by a number of
380
+ different teams, each with different goals and human evaluation metrics. These
381
+ models were evaluated against a number of different categories relevant to
382
+ ethics and safety, including:
383
+
384
+ - **Child Safety**: Evaluation of text-to-text and image to text prompts
385
+ covering child safety policies, including child sexual abuse and
386
+ exploitation.
387
+ - **Content Safety:** Evaluation of text-to-text and image to text prompts
388
+ covering safety policies including, harassment, violence and gore, and hate
389
+ speech.
390
+ - **Representational Harms**: Evaluation of text-to-text and image to text
391
+ prompts covering safety policies including bias, stereotyping, and harmful
392
+ associations or inaccuracies.
393
+
394
+ In addition to development level evaluations, we conduct "assurance
395
+ evaluations" which are our 'arms-length' internal evaluations for responsibility
396
+ governance decision making. They are conducted separately from the model
397
+ development team, to inform decision making about release. High level findings
398
+ are fed back to the model team, but prompt sets are held-out to prevent
399
+ overfitting and preserve the results' ability to inform decision making.
400
+ Assurance evaluation results are reported to our Responsibility & Safety Council
401
+ as part of release review.
402
+
403
+ ### Evaluation Results
404
+
405
+ For all areas of safety testing, we saw major improvements in the categories of
406
+ child safety, content safety, and representational harms relative to previous
407
+ Gemma models. All testing was conducted without safety filters to evaluate the
408
+ model capabilities and behaviors. For both text-to-text and image-to-text, and
409
+ across all model sizes, the model produced minimal policy violations, and showed
410
+ significant improvements over previous Gemma models' performance with respect
411
+ to ungrounded inferences. A limitation of our evaluations was they included only
412
+ English language prompts.
413
+
414
+ ## Usage and Limitations
415
+
416
+ These models have certain limitations that users should be aware of.
417
+
418
+ ### Intended Usage
419
+
420
+ Open vision-language models (VLMs) models have a wide range of applications
421
+ across various industries and domains. The following list of potential uses is
422
+ not comprehensive. The purpose of this list is to provide contextual information
423
+ about the possible use-cases that the model creators considered as part of model
424
+ training and development.
425
+
426
+ - Content Creation and Communication
427
+ - Text Generation: These models can be used to generate creative text
428
+ formats such as poems, scripts, code, marketing copy, and email drafts.
429
+ - Chatbots and Conversational AI: Power conversational interfaces
430
+ for customer service, virtual assistants, or interactive applications.
431
+ - Text Summarization: Generate concise summaries of a text corpus,
432
+ research papers, or reports.
433
+ - Image Data Extraction: These models can be used to extract,
434
+ interpret, and summarize visual data for text communications.
435
+ - Research and Education
436
+ - Natural Language Processing (NLP) and VLM Research: These
437
+ models can serve as a foundation for researchers to experiment with VLM
438
+ and NLP techniques, develop algorithms, and contribute to the
439
+ advancement of the field.
440
+ - Language Learning Tools: Support interactive language learning
441
+ experiences, aiding in grammar correction or providing writing practice.
442
+ - Knowledge Exploration: Assist researchers in exploring large
443
+ bodies of text by generating summaries or answering questions about
444
+ specific topics.
445
+
446
+ ### Limitations
447
+
448
+ - Training Data
449
+ - The quality and diversity of the training data significantly
450
+ influence the model's capabilities. Biases or gaps in the training data
451
+ can lead to limitations in the model's responses.
452
+ - The scope of the training dataset determines the subject areas
453
+ the model can handle effectively.
454
+ - Context and Task Complexity
455
+ - Models are better at tasks that can be framed with clear
456
+ prompts and instructions. Open-ended or highly complex tasks might be
457
+ challenging.
458
+ - A model's performance can be influenced by the amount of context
459
+ provided (longer context generally leads to better outputs, up to a
460
+ certain point).
461
+ - Language Ambiguity and Nuance
462
+ - Natural language is inherently complex. Models might struggle
463
+ to grasp subtle nuances, sarcasm, or figurative language.
464
+ - Factual Accuracy
465
+ - Models generate responses based on information they learned
466
+ from their training datasets, but they are not knowledge bases. They
467
+ may generate incorrect or outdated factual statements.
468
+ - Common Sense
469
+ - Models rely on statistical patterns in language. They might
470
+ lack the ability to apply common sense reasoning in certain situations.
471
+
472
+ ### Ethical Considerations and Risks
473
+
474
+ The development of vision-language models (VLMs) raises several ethical
475
+ concerns. In creating an open model, we have carefully considered the following:
476
+
477
+ - Bias and Fairness
478
+ - VLMs trained on large-scale, real-world text and image data can
479
+ reflect socio-cultural biases embedded in the training material. These
480
+ models underwent careful scrutiny, input data pre-processing described
481
+ and posterior evaluations reported in this card.
482
+ - Misinformation and Misuse
483
+ - VLMs can be misused to generate text that is false, misleading,
484
+ or harmful.
485
+ - Guidelines are provided for responsible use with the model, see the
486
+ [Responsible Generative AI Toolkit][rai-toolkit].
487
+ - Transparency and Accountability:
488
+ - This model card summarizes details on the models' architecture,
489
+ capabilities, limitations, and evaluation processes.
490
+ - A responsibly developed open model offers the opportunity to
491
+ share innovation by making VLM technology accessible to developers and
492
+ researchers across the AI ecosystem.
493
+
494
+ Risks identified and mitigations:
495
+
496
+ - **Perpetuation of biases**: It's encouraged to perform continuous
497
+ monitoring (using evaluation metrics, human review) and the exploration of
498
+ de-biasing techniques during model training, fine-tuning, and other use
499
+ cases.
500
+ - **Generation of harmful content**: Mechanisms and guidelines for content
501
+ safety are essential. Developers are encouraged to exercise caution and
502
+ implement appropriate content safety safeguards based on their specific
503
+ product policies and application use cases.
504
+ - **Misuse for malicious purposes**: Technical limitations and developer
505
+ and end-user education can help mitigate against malicious applications of
506
+ VLMs. Educational resources and reporting mechanisms for users to flag
507
+ misuse are provided. Prohibited uses of Gemma models are outlined in the
508
+ [Gemma Prohibited Use Policy][prohibited-use].
509
+ - **Privacy violations**: Models were trained on data filtered for removal
510
+ of certain personal information and other sensitive data. Developers are
511
+ encouraged to adhere to privacy regulations with privacy-preserving
512
+ techniques.
513
+
514
+ ### Benefits
515
+
516
+ At the time of release, this family of models provides high-performance open
517
+ vision-language model implementations designed from the ground up for
518
+ responsible AI development compared to similarly sized models.
519
+
520
+ Using the benchmark evaluation metrics described in this document, these models
521
+ have shown to provide superior performance to other, comparably-sized open model
522
+ alternatives.
523
+
524
+ [g3-tech-report]: https://goo.gle/Gemma3Report
525
+ [rai-toolkit]: https://ai.google.dev/responsible
526
+ [kaggle-gemma]: https://www.kaggle.com/models/google/gemma-3
527
+ [vertex-mg-gemma3]: https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/gemma3
528
+ [terms]: https://ai.google.dev/gemma/terms
529
+ [safety-policies]: https://ai.google/static/documents/ai-responsibility-update-published-february-2025.pdf
530
+ [prohibited-use]: https://ai.google.dev/gemma/prohibited_use_policy
531
+ [tpu]: https://cloud.google.com/tpu/docs/intro-to-tpu
532
+ [sustainability]: https://sustainability.google/operating-sustainably/
533
+ [jax]: https://github.com/jax-ml/jax
534
+ [ml-pathways]: https://blog.google/technology/ai/introducing-pathways-next-generation-ai-architecture/
535
+ [sustainability]: https://sustainability.google/operating-sustainably/
536
+ [gemini-2-paper]: https://arxiv.org/abs/2312.11805
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image_soft_token>": 262144
3
+ }
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma2ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attn_logit_softcapping": null,
8
+ "bos_token_id": 2,
9
+ "cache_implementation": "hybrid",
10
+ "eos_token_id": [
11
+ 1,
12
+ 106
13
+ ],
14
+ "final_logit_softcapping": null,
15
+ "head_dim": 256,
16
+ "hidden_activation": "gelu_pytorch_tanh",
17
+ "hidden_size": 1152,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 6912,
20
+ "max_position_embeddings": 32768,
21
+ "model_type": "gemma2",
22
+ "num_attention_heads": 4,
23
+ "num_hidden_layers": 26,
24
+ "num_key_value_heads": 1,
25
+ "pad_token_id": 0,
26
+ "query_pre_attn_scalar": 256,
27
+ "rms_norm_eps": 1e-06,
28
+ "rope_local_base_freq": 10000,
29
+ "rope_scaling": null,
30
+ "rope_theta": 1000000,
31
+ "sliding_window": 512,
32
+ "sliding_window_pattern": 6,
33
+ "torch_dtype": "bfloat16",
34
+ "transformers_version": "4.50.0.dev0",
35
+ "use_cache": true,
36
+ "vocab_size": 262144
37
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.50.0.dev0"
13
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<start_of_image>",
3
+ "bos_token": {
4
+ "content": "<bos>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<end_of_image>",
11
+ "eos_token": {
12
+ "content": "<eos>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<image_soft_token>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795
3
+ size 33384568
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
3
+ size 4689074
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff