zarnow commited on
Commit
ea1ccd2
·
verified ·
1 Parent(s): 5801196

Upload folder using huggingface_hub

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
README.md ADDED
@@ -0,0 +1,773 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - google/medgemma-4b-it
4
+ license: other
5
+ license_name: health-ai-developer-foundations
6
+ license_link: https://developers.google.com/health-ai-developer-foundations/terms
7
+ library_name: transformers
8
+ pipeline_tag: image-text-to-text
9
+ extra_gated_heading: Access MedGemma on Hugging Face
10
+ extra_gated_prompt: >-
11
+ To access MedGemma on Hugging Face, you're required to review and
12
+ agree to [Health AI Developer Foundation's terms of use](https://developers.google.com/health-ai-developer-foundations/terms).
13
+ To do this, please ensure you're logged in to Hugging Face and click below.
14
+ Requests are processed immediately.
15
+ extra_gated_button_content: Acknowledge license
16
+ tags:
17
+ - bnb-my-repo
18
+ - medical
19
+ - radiology
20
+ - clinical-reasoning
21
+ - dermatology
22
+ - pathology
23
+ - ophthalmology
24
+ - chest-x-ray
25
+ ---
26
+ # google/medgemma-4b-it (Quantized)
27
+
28
+ ## Description
29
+ This model is a quantized version of the original model [`google/medgemma-4b-it`](https://huggingface.co/google/medgemma-4b-it).
30
+
31
+ It's quantized using the BitsAndBytes library to 4-bit using the [bnb-my-repo](https://huggingface.co/spaces/bnb-community/bnb-my-repo) space.
32
+
33
+ ## Quantization Details
34
+ - **Quantization Type**: int4
35
+ - **bnb_4bit_quant_type**: nf4
36
+ - **bnb_4bit_use_double_quant**: True
37
+ - **bnb_4bit_compute_dtype**: bfloat16
38
+ - **bnb_4bit_quant_storage**: uint8
39
+
40
+
41
+
42
+ # 📄 Original Model Information
43
+
44
+
45
+
46
+ # MedGemma model card
47
+
48
+ **Model documentation:** [MedGemma](https://developers.google.com/health-ai-developer-foundations/medgemma)
49
+
50
+ **Resources:**
51
+
52
+ * Model on Google Cloud Model Garden: [MedGemma](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/medgemma)
53
+ * Model on Hugging Face: [MedGemma](https://huggingface.co/collections/google/medgemma-release-680aade845f90bec6a3f60c4)
54
+ * GitHub repository (supporting code, Colab notebooks, discussions, and
55
+ issues): [MedGemma](https://github.com/google-health/medgemma)
56
+ * Quick start notebook: [GitHub](https://github.com/google-health/medgemma/blob/main/notebooks/quick_start_with_hugging_face.ipynb)
57
+ * Fine-tuning notebook: [GitHub](https://github.com/google-health/medgemma/blob/main/notebooks/fine_tune_with_hugging_face.ipynb)
58
+ * Concept applications built using MedGemma: [Collection](https://huggingface.co/collections/google/medgemma-concept-apps-686ea036adb6d51416b0928a)
59
+ * Support: See [Contact](https://developers.google.com/health-ai-developer-foundations/medgemma/get-started.md#contact)
60
+ * License: The use of MedGemma is governed by the [Health AI Developer
61
+ Foundations terms of
62
+ use](https://developers.google.com/health-ai-developer-foundations/terms).
63
+
64
+ **Author:** Google
65
+
66
+ ## Model information
67
+
68
+ This section describes the MedGemma model and how to use it.
69
+
70
+ ### Description
71
+
72
+ MedGemma is a collection of [Gemma 3](https://ai.google.dev/gemma/docs/core)
73
+ variants that are trained for performance on medical text and image
74
+ comprehension. Developers can use MedGemma to accelerate building
75
+ healthcare-based AI applications. MedGemma currently comes in three variants: a
76
+ 4B multimodal version and 27B text-only and multimodal versions.
77
+
78
+ Both MedGemma multimodal versions utilize a
79
+ [SigLIP](https://arxiv.org/abs/2303.15343) image encoder that has been
80
+ specifically pre-trained on a variety of de-identified medical data, including
81
+ chest X-rays, dermatology images, ophthalmology images, and histopathology
82
+ slides. Their LLM components are trained on a diverse set of medical data,
83
+ including medical text, medical question-answer pairs, FHIR-based electronic
84
+ health record data (27B multimodal only), radiology images, histopathology
85
+ patches, ophthalmology images, and dermatology images.
86
+
87
+ MedGemma 4B is available in both pre-trained (suffix: `-pt`) and
88
+ instruction-tuned (suffix `-it`) versions. The instruction-tuned version is a
89
+ better starting point for most applications. The pre-trained version is
90
+ available for those who want to experiment more deeply with the models.
91
+
92
+ MedGemma 27B multimodal has pre-training on medical image, medical record and
93
+ medical record comprehension tasks. MedGemma 27B text-only has been trained
94
+ exclusively on medical text. Both models have been optimized for inference-time
95
+ computation on medical reasoning. This means it has slightly higher performance
96
+ on some text benchmarks than MedGemma 27B multimodal. Users who want to work
97
+ with a single model for both medical text, medical record and medical image
98
+ tasks are better suited for MedGemma 27B multimodal. Those that only need text
99
+ use-cases may be better served with the text-only variant. Both MedGemma 27B
100
+ variants are only available in instruction-tuned versions.
101
+
102
+ MedGemma variants have been evaluated on a range of clinically relevant
103
+ benchmarks to illustrate their baseline performance. These evaluations are based
104
+ on both open benchmark datasets and curated datasets. Developers can fine-tune
105
+ MedGemma variants for improved performance. Consult the [Intended
106
+ Use](https://developers.google.com/health-ai-developer-foundations/medgemma/model-card#intended_use)
107
+ section below for more details.
108
+
109
+ MedGemma is optimized for medical applications that involve a text generation
110
+ component. For medical image-based applications that do not involve text
111
+ generation, such as data-efficient classification, zero-shot classification, or
112
+ content-based or semantic image retrieval, the [MedSigLIP image
113
+ encoder](https://developers.google.com/health-ai-developer-foundations/medsiglip/model-card)
114
+ is recommended. MedSigLIP is based on the same image encoder that powers
115
+ MedGemma.
116
+
117
+ Please consult the [MedGemma Technical Report](https://arxiv.org/abs/2507.05201)
118
+ for more details.
119
+
120
+ ### How to use
121
+
122
+ Below are some example code snippets to help you quickly get started running the
123
+ model locally on GPU. If you want to use the model at scale, we recommend that
124
+ you create a production version using [Model
125
+ Garden](https://cloud.google.com/model-garden).
126
+
127
+ First, install the Transformers library. Gemma 3 is supported starting from
128
+ transformers 4.50.0.
129
+
130
+ ```sh
131
+ $ pip install -U transformers
132
+ ```
133
+
134
+ **Run model with the `pipeline` API**
135
+
136
+ ```python
137
+ from transformers import pipeline
138
+ from PIL import Image
139
+ import requests
140
+ import torch
141
+
142
+ pipe = pipeline(
143
+ "image-text-to-text",
144
+ model="google/medgemma-4b-it",
145
+ torch_dtype=torch.bfloat16,
146
+ device="cuda",
147
+ )
148
+
149
+ # Image attribution: Stillwaterising, CC0, via Wikimedia Commons
150
+ image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
151
+ image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
152
+
153
+ messages = [
154
+ {
155
+ "role": "system",
156
+ "content": [{"type": "text", "text": "You are an expert radiologist."}]
157
+ },
158
+ {
159
+ "role": "user",
160
+ "content": [
161
+ {"type": "text", "text": "Describe this X-ray"},
162
+ {"type": "image", "image": image}
163
+ ]
164
+ }
165
+ ]
166
+
167
+ output = pipe(text=messages, max_new_tokens=200)
168
+ print(output[0]["generated_text"][-1]["content"])
169
+ ```
170
+
171
+ **Run the model directly**
172
+
173
+ ```python
174
+ # pip install accelerate
175
+ from transformers import AutoProcessor, AutoModelForImageTextToText
176
+ from PIL import Image
177
+ import requests
178
+ import torch
179
+
180
+ model_id = "google/medgemma-4b-it"
181
+
182
+ model = AutoModelForImageTextToText.from_pretrained(
183
+ model_id,
184
+ torch_dtype=torch.bfloat16,
185
+ device_map="auto",
186
+ )
187
+ processor = AutoProcessor.from_pretrained(model_id)
188
+
189
+ # Image attribution: Stillwaterising, CC0, via Wikimedia Commons
190
+ image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
191
+ image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
192
+
193
+ messages = [
194
+ {
195
+ "role": "system",
196
+ "content": [{"type": "text", "text": "You are an expert radiologist."}]
197
+ },
198
+ {
199
+ "role": "user",
200
+ "content": [
201
+ {"type": "text", "text": "Describe this X-ray"},
202
+ {"type": "image", "image": image}
203
+ ]
204
+ }
205
+ ]
206
+
207
+ inputs = processor.apply_chat_template(
208
+ messages, add_generation_prompt=True, tokenize=True,
209
+ return_dict=True, return_tensors="pt"
210
+ ).to(model.device, dtype=torch.bfloat16)
211
+
212
+ input_len = inputs["input_ids"].shape[-1]
213
+
214
+ with torch.inference_mode():
215
+ generation = model.generate(**inputs, max_new_tokens=200, do_sample=False)
216
+ generation = generation[0][input_len:]
217
+
218
+ decoded = processor.decode(generation, skip_special_tokens=True)
219
+ print(decoded)
220
+ ```
221
+
222
+ ### Examples
223
+
224
+ See the following Colab notebooks for examples of how to use MedGemma:
225
+
226
+ * To give the model a quick try, running it locally with weights from Hugging
227
+ Face, see [Quick start notebook in
228
+ Colab](https://colab.research.google.com/github/google-health/medgemma/blob/main/notebooks/quick_start_with_hugging_face.ipynb).
229
+ Note that you will need to use Colab Enterprise to obtain adequate GPU
230
+ resources to run either 27B model without quantization.
231
+
232
+ * For an example of fine-tuning the 4B model, see the [Fine-tuning notebook in
233
+ Colab](https://colab.research.google.com/github/google-health/medgemma/blob/main/notebooks/fine_tune_with_hugging_face.ipynb).
234
+ The 27B models can be fine tuned in a similar manner but will require more
235
+ time and compute resources than the 4B model.
236
+
237
+ ### Model architecture overview
238
+
239
+ The MedGemma model is built based on [Gemma 3](https://ai.google.dev/gemma/) and
240
+ uses the same decoder-only transformer architecture as Gemma 3\. To read more
241
+ about the architecture, consult the Gemma 3 [model
242
+ card](https://ai.google.dev/gemma/docs/core/model_card_3).
243
+
244
+ ### Technical specifications
245
+
246
+ * **Model type**: Decoder-only Transformer architecture, see the [Gemma 3
247
+ Technical
248
+ Report](https://storage.googleapis.com/deepmind-media/gemma/Gemma3Report.pdf)
249
+ * **Input Modalities**: Text, vision
250
+ * **Output Modality:** Text only
251
+ * **Attention mechanism**: Grouped-query attention (GQA)
252
+ * **Context length**: Supports long context, at least 128K tokens
253
+ * **Key publication**: https://arxiv.org/abs/2507.05201
254
+ * **Model created**: July 9, 2025
255
+
256
+ * **Model version**: 1.0.1
257
+
258
+ ### Citation
259
+
260
+ When using this model, please cite: Sellergren et al. "MedGemma Technical
261
+ Report." *arXiv preprint arXiv:2507.05201* (2025).
262
+
263
+ ```none
264
+ @article{sellergren2025medgemma,
265
+ title={MedGemma Technical Report},
266
+ author={Sellergren, Andrew and Kazemzadeh, Sahar and Jaroensri, Tiam and Kiraly, Atilla and Traverse, Madeleine and Kohlberger, Timo and Xu, Shawn and Jamil, Fayaz and Hughes, Cían and Lau, Charles and others},
267
+ journal={arXiv preprint arXiv:2507.05201},
268
+ year={2025}
269
+ }
270
+ ```
271
+
272
+ ### Inputs and outputs
273
+
274
+ **Input**:
275
+
276
+ * Text string, such as a question or prompt
277
+ * Images, normalized to 896 x 896 resolution and encoded to 256 tokens each
278
+ * Total input length of 128K tokens
279
+
280
+ **Output**:
281
+
282
+ * Generated text in response to the input, such as an answer to a question,
283
+ analysis of image content, or a summary of a document
284
+ * Total output length of 8192 tokens
285
+
286
+ ### Performance and validation
287
+
288
+ MedGemma was evaluated across a range of different multimodal classification,
289
+ report generation, visual question answering, and text-based tasks.
290
+
291
+ ### Key performance metrics
292
+
293
+ #### Imaging evaluations
294
+
295
+ The multimodal performance of MedGemma 4B and 27B multimodal was evaluated
296
+ across a range of benchmarks, focusing on radiology, dermatology,
297
+ histopathology, ophthalmology, and multimodal clinical reasoning.
298
+
299
+ MedGemma 4B outperforms the base Gemma 3 4B model across all tested multimodal
300
+ health benchmarks.
301
+
302
+ | Task and metric | Gemma 3 4B | MedGemma 4B |
303
+ | :---- | :---- | :---- |
304
+ | **Medical image classification** | | |
305
+ | MIMIC CXR\*\* \- macro F1 for top 5 conditions | 81.2 | 88.9 |
306
+ | CheXpert CXR \- macro F1 for top 5 conditions | 32.6 | 48.1 |
307
+ | CXR14 \- macro F1 for 3 conditions | 32.0 | 50.1 |
308
+ | PathMCQA\* (histopathology, internal\*\*) \- Accuracy | 37.1 | 69.8 |
309
+ | US-DermMCQA\* \- Accuracy | 52.5 | 71.8 |
310
+ | EyePACS\* (fundus, internal) \- Accuracy | 14.4 | 64.9 |
311
+ | **Visual question answering** | | |
312
+ | SLAKE (radiology) \- Tokenized F1 | 40.2 | 72.3 |
313
+ | VQA-RAD\*\*\* (radiology) \- Tokenized F1 | 33.6 | 49.9 |
314
+ | **Knowledge and reasoning** | | | | |
315
+ | MedXpertQA (text \+ multimodal questions) \- Accuracy | 16.4 | 18.8 |
316
+
317
+ *Internal datasets. US-DermMCQA is described in [Liu (2020, Nature
318
+ medicine)](https://www.nature.com/articles/s41591-020-0842-3), presented as a
319
+ 4-way MCQ per example for skin condition classification. PathMCQA is based on
320
+ multiple datasets, presented as 3-9 way MCQ per example for identification,
321
+ grading, and subtype for breast, cervical, and prostate cancer. EyePACS is a
322
+ dataset of fundus images with classification labels based on 5-level diabetic
323
+ retinopathy severity (None, Mild, Moderate, Severe, Proliferative). More details
324
+ in the [MedGemma Technical Report](https://arxiv.org/abs/2507.05201).
325
+
326
+ **Based on radiologist adjudicated labels, described in [Yang (2024,
327
+ arXiv)](https://arxiv.org/pdf/2405.03162) Section A.1.1.
328
+
329
+ ***Based on "balanced split," described in [Yang (2024,
330
+ arXiv)](https://arxiv.org/pdf/2405.03162).
331
+
332
+ #### Chest X-ray report generation
333
+
334
+ MedGemma chest X-ray (CXR) report generation performance was evaluated on
335
+ [MIMIC-CXR](https://physionet.org/content/mimic-cxr/2.1.0/) using the [RadGraph
336
+ F1 metric](https://arxiv.org/abs/2106.14463). We compare the MedGemma
337
+ pre-trained checkpoint with our previous best model for CXR report generation,
338
+ [PaliGemma 2](https://arxiv.org/abs/2412.03555).
339
+
340
+ | Metric | MedGemma 4B (pre-trained) | MedGemma 4B (tuned for CXR)| PaliGemma 2 3B (tuned for CXR) | PaliGemma 2 10B (tuned for CXR) |
341
+ | :---- | :---- | :---- | :---- | :---- |
342
+ | MIMIC CXR \- RadGraph F1 | 29.5 | 30.3 |28.8 | 29.5 |
343
+
344
+
345
+
346
+ The instruction-tuned versions of MedGemma 4B and MedGemma 27B achieve lower
347
+ scores (21.9 and 21.3, respectively) due to the differences in reporting style
348
+ compared to the MIMIC ground truth reports. Further fine-tuning on MIMIC reports
349
+ enables users to achieve improved performance, as shown by the improved
350
+ performance of the MedGemma 4B model that was tuned for CXR.
351
+
352
+ #### Text evaluations
353
+
354
+ MedGemma 4B and text-only MedGemma 27B were evaluated across a range of
355
+ text-only benchmarks for medical knowledge and reasoning.
356
+
357
+ The MedGemma models outperform their respective base Gemma models across all
358
+ tested text-only health benchmarks.
359
+
360
+ | Metric | Gemma 3 4B | MedGemma 4B |
361
+ | :---- | :---- | :---- |
362
+ | MedQA (4-op) | 50.7 | 64.4 |
363
+ | MedMCQA | 45.4 | 55.7 |
364
+ | PubMedQA | 68.4 | 73.4 |
365
+ | MMLU Med | 67.2 | 70.0 |
366
+ | MedXpertQA (text only) | 11.6 | 14.2 |
367
+ | AfriMed-QA (25 question test set) | 48.0 | 52.0 |
368
+
369
+ For all MedGemma 27B results, [test-time
370
+ scaling](https://arxiv.org/abs/2501.19393) is used to improve performance.
371
+
372
+ #### Medical record evaluations
373
+
374
+ All models were evaluated on a question answer dataset from synthetic FHIR data
375
+ to answer questions about patient records. MedGemma 27B multimodal's
376
+ FHIR-specific training gives it significant improvement over other MedGemma and
377
+ Gemma models.
378
+
379
+ | Metric | Gemma 3 4B | MedGemma 4B |
380
+ | :---- | :---- | :---- |
381
+ | EHRQA | 70.9 | 67.6 |
382
+
383
+
384
+ ### Ethics and safety evaluation
385
+
386
+ #### Evaluation approach
387
+
388
+ Our evaluation methods include structured evaluations and internal red-teaming
389
+ testing of relevant content policies. Red-teaming was conducted by a number of
390
+ different teams, each with different goals and human evaluation metrics. These
391
+ models were evaluated against a number of different categories relevant to
392
+ ethics and safety, including:
393
+
394
+ * **Child safety**: Evaluation of text-to-text and image-to-text prompts
395
+ covering child safety policies, including child sexual abuse and
396
+ exploitation.
397
+ * **Content safety:** Evaluation of text-to-text and image-to-text prompts
398
+ covering safety policies, including harassment, violence and gore, and hate
399
+ speech.
400
+ * **Representational harms**: Evaluation of text-to-text and image-to-text
401
+ prompts covering safety policies, including bias, stereotyping, and harmful
402
+ associations or inaccuracies.
403
+ * **General medical harms:** Evaluation of text-to-text and image-to-text
404
+ prompts covering safety policies, including information quality and harmful
405
+ associations or inaccuracies.
406
+
407
+ In addition to development level evaluations, we conduct "assurance evaluations"
408
+ which are our "arms-length" internal evaluations for responsibility governance
409
+ decision making. They are conducted separately from the model development team,
410
+ to inform decision making about release. High-level findings are fed back to the
411
+ model team, but prompt sets are held out to prevent overfitting and preserve the
412
+ results' ability to inform decision making. Notable assurance evaluation results
413
+ are reported to our Responsibility & Safety Council as part of release review.
414
+
415
+ #### Evaluation results
416
+
417
+ For all areas of safety testing, we saw safe levels of performance across the
418
+ categories of child safety, content safety, and representational harms. All
419
+ testing was conducted without safety filters to evaluate the model capabilities
420
+ and behaviors. For text-to-text, image-to-text, and audio-to-text, and across
421
+ both MedGemma model sizes, the model produced minimal policy violations. A
422
+ limitation of our evaluations was that they included primarily English language
423
+ prompts.
424
+
425
+ ## Data card
426
+
427
+ ### Dataset overview
428
+
429
+ #### Training
430
+
431
+ The base Gemma models are pre-trained on a large corpus of text and code data.
432
+ MedGemma 4B utilizes a [SigLIP](https://arxiv.org/abs/2303.15343) image encoder
433
+ that has been specifically pre-trained on a variety of de-identified medical
434
+ data, including radiology images, histopathology images, ophthalmology images,
435
+ and dermatology images. Its LLM component is trained on a diverse set of medical
436
+ data, including medical text relevant to radiology images, chest-x rays,
437
+ histopathology patches, ophthalmology images and dermatology images.
438
+
439
+ #### Evaluation
440
+
441
+ MedGemma models have been evaluated on a comprehensive set of clinically
442
+ relevant benchmarks, including over 22 datasets across 5 different tasks and 6
443
+ medical image modalities. These include both open benchmark datasets and curated
444
+ datasets, with a focus on expert human evaluations for tasks like CXR report
445
+ generation and radiology VQA.
446
+
447
+ ### Ethics and safety evaluation
448
+
449
+ #### Evaluation approach
450
+
451
+ Our evaluation methods include structured evaluations and internal red-teaming
452
+ testing of relevant content policies. Red-teaming was conducted by a number of
453
+ different teams, each with different goals and human evaluation metrics. These
454
+ models were evaluated against a number of different categories relevant to
455
+ ethics and safety, including:
456
+
457
+ * **Child safety**: Evaluation of text-to-text and image-to-text prompts
458
+ covering child safety policies, including child sexual abuse and
459
+ exploitation.
460
+ * **Content safety:** Evaluation of text-to-text and image-to-text prompts
461
+ covering safety policies, including harassment, violence and gore, and hate
462
+ speech.
463
+ * **Representational harms**: Evaluation of text-to-text and image-to-text
464
+ prompts covering safety policies, including bias, stereotyping, and harmful
465
+ associations or inaccuracies.
466
+ * **General medical harms:** Evaluation of text-to-text and image-to-text
467
+ prompts covering safety policies, including information quality and harmful
468
+ associations or inaccuracies.
469
+
470
+ In addition to development level evaluations, we conduct "assurance evaluations"
471
+ which are our "arms-length" internal evaluations for responsibility governance
472
+ decision making. They are conducted separately from the model development team,
473
+ to inform decision making about release. High-level findings are fed back to the
474
+ model team, but prompt sets are held out to prevent overfitting and preserve the
475
+ results' ability to inform decision making. Notable assurance evaluation results
476
+ are reported to our Responsibility & Safety Council as part of release review.
477
+
478
+ #### Evaluation results
479
+
480
+ For all areas of safety testing, we saw safe levels of performance across the
481
+ categories of child safety, content safety, and representational harms. All
482
+ testing was conducted without safety filters to evaluate the model capabilities
483
+ and behaviors. For text-to-text, image-to-text, and audio-to-text, and across
484
+ both MedGemma model sizes, the model produced minimal policy violations. A
485
+ limitation of our evaluations was that they included primarily English language
486
+ prompts.
487
+
488
+ ## Data card
489
+
490
+ ### Dataset overview
491
+
492
+ #### Training
493
+
494
+ The base Gemma models are pre-trained on a large corpus of text and code data.
495
+ MedGemma multimodal variants utilize a
496
+ [SigLIP](https://arxiv.org/abs/2303.15343) image encoder that has been
497
+ specifically pre-trained on a variety of de-identified medical data, including
498
+ radiology images, histopathology images, ophthalmology images, and dermatology
499
+ images. Their LLM component is trained on a diverse set of medical data,
500
+ including medical text, medical question-answer pairs, FHIR-based electronic
501
+ health record data (27B multimodal only), radiology images, histopathology
502
+ patches, ophthalmology images, and dermatology images.
503
+
504
+ #### Evaluation
505
+
506
+ MedGemma models have been evaluated on a comprehensive set of clinically
507
+ relevant benchmarks, including over 22 datasets across 6 different tasks and 4
508
+ medical image modalities. These benchmarks include both open and internal
509
+ datasets.
510
+
511
+ #### Source
512
+
513
+ MedGemma utilizes a combination of public and private datasets.
514
+
515
+ This model was trained on diverse public datasets including MIMIC-CXR (chest
516
+ X-rays and reports), ChestImaGenome: Set of bounding boxes linking image
517
+ findings with anatomical regions for MIMIC-CXR (MedGemma 27B multimodal only),
518
+ SLAKE (multimodal medical images and questions), PAD-UFES-20 (skin lesion images
519
+ and data), SCIN (dermatology images), TCGA (cancer genomics data), CAMELYON
520
+ (lymph node histopathology images), PMC-OA (biomedical literature with images),
521
+ and Mendeley Digital Knee X-Ray (knee X-rays).
522
+
523
+ Additionally, multiple diverse proprietary datasets were licensed and
524
+ incorporated (described next).
525
+
526
+ ### Data Ownership and Documentation
527
+
528
+ * [MIMIC-CXR](https://physionet.org/content/mimic-cxr/2.1.0/): MIT Laboratory
529
+ for Computational Physiology and Beth Israel Deaconess Medical Center
530
+ (BIDMC).
531
+ * [Slake-VQA](https://www.med-vqa.com/slake/): The Hong Kong Polytechnic
532
+ University (PolyU), with collaborators including West China Hospital of
533
+ Sichuan University and Sichuan Academy of Medical Sciences / Sichuan
534
+ Provincial People's Hospital.
535
+ * [PAD-UFES-20](https://pmc.ncbi.nlm.nih.gov/articles/PMC7479321/): Federal
536
+ University of Espírito Santo (UFES), Brazil, through its Dermatological and
537
+ Surgical Assistance Program (PAD).
538
+ * [SCIN](https://github.com/google-research-datasets/scin): A collaboration
539
+ between Google Health and Stanford Medicine.
540
+ * [TCGA](https://portal.gdc.cancer.gov/) (The Cancer Genome Atlas): A joint
541
+ effort of National Cancer Institute and National Human Genome Research
542
+ Institute. Data from TCGA are available via the Genomic Data Commons (GDC)
543
+ * [CAMELYON](https://camelyon17.grand-challenge.org/Data/): The data was
544
+ collected from Radboud University Medical Center and University Medical
545
+ Center Utrecht in the Netherlands.
546
+ * [PMC-OA (PubMed Central Open Access
547
+ Subset)](https://catalog.data.gov/dataset/pubmed-central-open-access-subset-pmc-oa):
548
+ Maintained by the National Library of Medicine (NLM) and National Center for
549
+ Biotechnology Information (NCBI), which are part of the NIH.
550
+ * [MedQA](https://arxiv.org/pdf/2009.13081): This dataset was created by a
551
+ team of researchers led by Di Jin, Eileen Pan, Nassim Oufattole, Wei-Hung
552
+ Weng, Hanyi Fang, and Peter Szolovits
553
+ * [Mendeley Digital Knee
554
+ X-Ray](https://data.mendeley.com/datasets/t9ndx37v5h/1): This dataset is
555
+ from Rani Channamma University, and is hosted on Mendeley Data.
556
+ * [AfriMed-QA](https://afrimedqa.com/): This data was developed and led by
557
+ multiple collaborating organizations and researchers include key
558
+ contributors: Intron Health, SisonkeBiotik, BioRAMP, Georgia Institute of
559
+ Technology, and MasakhaneNLP.
560
+ * [VQA-RAD](https://www.nature.com/articles/sdata2018251): This dataset was
561
+ created by a research team led by Jason J. Lau, Soumya Gayen, Asma Ben
562
+ Abacha, and Dina Demner-Fushman and their affiliated institutions (the US
563
+ National Library of Medicine and National Institutes of Health)
564
+ * [Chest ImaGenome](https://physionet.org/content/chest-imagenome/1.0.0/): IBM
565
+ Research.
566
+ * [MedExpQA](https://www.sciencedirect.com/science/article/pii/S0933365724001805):
567
+ This dataset was created by researchers at the HiTZ Center (Basque Center
568
+ for Language Technology and Artificial Intelligence).
569
+ * [MedXpertQA](https://huggingface.co/datasets/TsinghuaC3I/MedXpertQA): This
570
+ dataset was developed by researchers at Tsinghua University (Beijing, China)
571
+ and Shanghai Artificial Intelligence Laboratory (Shanghai, China).
572
+ * [HealthSearchQA](https://huggingface.co/datasets/katielink/healthsearchqa):
573
+ This dataset consists of consisting of 3,173 commonly searched consumer
574
+ questions
575
+
576
+ In addition to the public datasets listed above, MedGemma was also trained on
577
+ de-identified, licensed datasets or datasets collected internally at Google from
578
+ consented participants.
579
+
580
+ * **Radiology dataset 1:** De-identified dataset of different CT studies
581
+ across body parts from a US-based radiology outpatient diagnostic center
582
+ network.
583
+ * **Ophthalmology dataset 1 (EyePACS):** De-identified dataset of fundus
584
+ images from diabetic retinopathy screening.
585
+ * **Dermatology dataset 1:** De-identified dataset of teledermatology skin
586
+ condition images (both clinical and dermatoscopic) from Colombia.
587
+ * **Dermatology dataset 2:** De-identified dataset of skin cancer images (both
588
+ clinical and dermatoscopic) from Australia.
589
+ * **Dermatology dataset 3:** De-identified dataset of non-diseased skin images
590
+ from an internal data collection effort.
591
+ * **Pathology dataset 1:** De-identified dataset of histopathology H\&E whole
592
+ slide images created in collaboration with an academic research hospital and
593
+ biobank in Europe. Comprises de-identified colon, prostate, and lymph nodes.
594
+ * **Pathology dataset 2:** De-identified dataset of lung histopathology H\&E
595
+ and IHC whole slide images created by a commercial biobank in the United
596
+ States.
597
+ * **Pathology dataset 3:** De-identified dataset of prostate and lymph node
598
+ H\&E and IHC histopathology whole slide images created by a contract
599
+ research organization in the United States.
600
+ * **Pathology dataset 4:** De-identified dataset of histopathology whole slide
601
+ images created in collaboration with a large, tertiary teaching hospital in
602
+ the United States. Comprises a diverse set of tissue and stain types,
603
+ predominantly H\&E.
604
+ * **EHR dataset 1:** Question/answer dataset drawn from synthetic FHIR records
605
+ created by [Synthea.](https://synthetichealth.github.io/synthea/) The test
606
+ set includes 19 unique patients with 200 questions per patient divided into
607
+ 10 different categories.
608
+
609
+ ### Data citation
610
+
611
+ * **MIMIC-CXR:** Johnson, A., Pollard, T., Mark, R., Berkowitz, S., & Horng,
612
+ S. (2024). MIMIC-CXR Database (version 2.1.0). PhysioNet.
613
+ [https://physionet.org/content/mimic-cxr/2.1.0/](https://physionet.org/content/mimic-cxr/2.1.0/)
614
+ *and* Johnson, Alistair E. W., Tom J. Pollard, Seth J. Berkowitz, Nathaniel
615
+ R. Greenbaum, Matthew P. Lungren, Chih-Ying Deng, Roger G. Mark, and Steven
616
+ Horng. 2019\. "MIMIC-CXR, a de-Identified Publicly Available Database of
617
+ Chest Radiographs with Free-Text Reports." *Scientific Data 6* (1): 1–8.
618
+
619
+ * **SLAKE:** Liu, Bo, Li-Ming Zhan, Li Xu, Lin Ma, Yan Yang, and Xiao-Ming Wu.
620
+ 2021.SLAKE: A Semantically-Labeled Knowledge-Enhanced Dataset for Medical
621
+ Visual Question Answering."
622
+ [http://arxiv.org/abs/2102.09542](http://arxiv.org/abs/2102.09542).
623
+
624
+ * **PAD-UEFS-20:** Pacheco, Andre GC, et al. "PAD-UFES-20: A skin lesion
625
+ dataset composed of patient data and clinical images collected from
626
+ smartphones." *Data in brief* 32 (2020): 106221\.
627
+
628
+ * **SCIN:** Ward, Abbi, Jimmy Li, Julie Wang, Sriram Lakshminarasimhan, Ashley
629
+ Carrick, Bilson Campana, Jay Hartford, et al. 2024\. "Creating an Empirical
630
+ Dermatology Dataset Through Crowdsourcing With Web Search Advertisements."
631
+ *JAMA Network Open 7* (11): e2446615–e2446615.
632
+
633
+ * **TCGA:** The results shown here are in whole or part based upon data
634
+ generated by the TCGA Research Network:
635
+ [https://www.cancer.gov/tcga](https://www.cancer.gov/tcga).
636
+
637
+ * **CAMELYON16:** Ehteshami Bejnordi, Babak, Mitko Veta, Paul Johannes van
638
+ Diest, Bram van Ginneken, Nico Karssemeijer, Geert Litjens, Jeroen A. W. M.
639
+ van der Laak, et al. 2017\. "Diagnostic Assessment of Deep Learning
640
+ Algorithms for Detection of Lymph Node Metastases in Women With Breast
641
+ Cancer." *JAMA 318* (22): 2199–2210.
642
+
643
+ * **Mendeley Digital Knee X-Ray:** Gornale, Shivanand; Patravali, Pooja
644
+ (2020), "Digital Knee X-ray Images", Mendeley Data, V1, doi:
645
+ 10.17632/t9ndx37v5h.1
646
+
647
+ * **VQA-RAD:** Lau, Jason J., Soumya Gayen, Asma Ben Abacha, and Dina
648
+ Demner-Fushman. 2018\. "A Dataset of Clinically Generated Visual Questions
649
+ and Answers about Radiology Images." *Scientific Data 5* (1): 1–10.
650
+
651
+ * **Chest ImaGenome:** Wu, J., Agu, N., Lourentzou, I., Sharma, A., Paguio,
652
+ J., Yao, J. S., Dee, E. C., Mitchell, W., Kashyap, S., Giovannini, A., Celi,
653
+ L. A., Syeda-Mahmood, T., & Moradi, M. (2021). Chest ImaGenome Dataset
654
+ (version 1.0.0). PhysioNet. RRID:SCR\_007345.
655
+ [https://doi.org/10.13026/wv01-y230](https://doi.org/10.13026/wv01-y230)
656
+
657
+ * **MedQA:** Jin, Di, Eileen Pan, Nassim Oufattole, Wei-Hung Weng, Hanyi Fang,
658
+ and Peter Szolovits. 2020\. "What Disease Does This Patient Have? A
659
+ Large-Scale Open Domain Question Answering Dataset from Medical Exams."
660
+ [http://arxiv.org/abs/2009.13081](http://arxiv.org/abs/2009.13081).
661
+
662
+ * **AfrimedQA:** Olatunji, Tobi, Charles Nimo, Abraham Owodunni, Tassallah
663
+ Abdullahi, Emmanuel Ayodele, Mardhiyah Sanni, Chinemelu Aka, et al. 2024\.
664
+ "AfriMed-QA: A Pan-African, Multi-Specialty, Medical Question-Answering
665
+ Benchmark Dataset."
666
+ [http://arxiv.org/abs/2411.15640](http://arxiv.org/abs/2411.15640).
667
+
668
+ * **MedExpQA:** Alonso, I., Oronoz, M., & Agerri, R. (2024). MedExpQA:
669
+ Multilingual Benchmarking of Large Language Models for Medical Question
670
+ Answering. *arXiv preprint arXiv:2404.05590*. Retrieved from
671
+ [https://arxiv.org/abs/2404.05590](https://arxiv.org/abs/2404.05590)
672
+
673
+ * **MedXpertQA:** Zuo, Yuxin, Shang Qu, Yifei Li, Zhangren Chen, Xuekai Zhu,
674
+ Ermo Hua, Kaiyan Zhang, Ning Ding, and Bowen Zhou. 2025\. "MedXpertQA:
675
+ Benchmarking Expert-Level Medical Reasoning and Understanding."
676
+ [http://arxiv.org/abs/2501.18362](http://arxiv.org/abs/2501.18362).
677
+
678
+ ### De-identification/anonymization:
679
+
680
+ Google and its partners utilize datasets that have been rigorously anonymized or
681
+ de-identified to ensure the protection of individual research participants and
682
+ patient privacy.
683
+
684
+ ## Implementation information
685
+
686
+ Details about the model internals.
687
+
688
+ ### Software
689
+
690
+ Training was done using [JAX](https://github.com/jax-ml/jax).
691
+
692
+ JAX allows researchers to take advantage of the latest generation of hardware,
693
+ including TPUs, for faster and more efficient training of large models.
694
+
695
+ ## Use and limitations
696
+
697
+ ### Intended use
698
+
699
+ MedGemma is an open multimodal generative AI model intended to be used as a
700
+ starting point that enables more efficient development of downstream healthcare
701
+ applications involving medical text and images. MedGemma is intended for
702
+ developers in the life sciences and healthcare space. Developers are responsible
703
+ for training, adapting and making meaningful changes to MedGemma to accomplish
704
+ their specific intended use. MedGemma models can be fine-tuned by developers
705
+ using their own proprietary data for their specific tasks or solutions.
706
+
707
+ MedGemma is based on Gemma 3 and has been further trained on medical images and
708
+ text. MedGemma enables further development in any medical context (image and
709
+ textual), however the model was pre-trained using chest X-ray, pathology,
710
+ dermatology, and fundus images. Examples of tasks within MedGemma's training
711
+ include visual question answering pertaining to medical images, such as
712
+ radiographs, or providing answers to textual medical questions. Full details of
713
+ all the tasks MedGemma has been evaluated can be found in the [MedGemma
714
+ Technical Report](https://arxiv.org/abs/2507.05201).
715
+
716
+ ### Benefits
717
+
718
+ * Provides strong baseline medical image and text comprehension for models of
719
+ its size.
720
+ * This strong performance makes it efficient to adapt for downstream
721
+ healthcare-based use cases, compared to models of similar size without
722
+ medical data pre-training.
723
+ * This adaptation may involve prompt engineering, grounding, agentic
724
+ orchestration or fine-tuning depending on the use case, baseline validation
725
+ requirements, and desired performance characteristics.
726
+
727
+ ### Limitations
728
+
729
+ MedGemma is not intended to be used without appropriate validation, adaptation
730
+ and/or making meaningful modification by developers for their specific use case.
731
+ The outputs generated by MedGemma are not intended to directly inform clinical
732
+ diagnosis, patient management decisions, treatment recommendations, or any other
733
+ direct clinical practice applications. Performance benchmarks highlight baseline
734
+ capabilities on relevant benchmarks, but even for image and text domains that
735
+ constitute a substantial portion of training data, inaccurate model output is
736
+ possible. All outputs from MedGemma should be considered preliminary and require
737
+ independent verification, clinical correlation, and further investigation
738
+ through established research and development methodologies.
739
+
740
+ MedGemma's multimodal capabilities have been primarily evaluated on single-image
741
+ tasks. MedGemma has not been evaluated in use cases that involve comprehension
742
+ of multiple images.
743
+
744
+ MedGemma has not been evaluated or optimized for multi-turn applications.
745
+
746
+ MedGemma's training may make it more sensitive to the specific prompt used than
747
+ Gemma 3\.
748
+
749
+ When adapting MedGemma developer should consider the following:
750
+
751
+ * **Bias in validation data:** As with any research, developers should ensure
752
+ that any downstream application is validated to understand performance using
753
+ data that is appropriately representative of the intended use setting for
754
+ the specific application (e.g., age, sex, gender, condition, imaging device,
755
+ etc).
756
+ * **Data contamination concerns**: When evaluating the generalization
757
+ capabilities of a large model like MedGemma in a medical context, there is a
758
+ risk of data contamination, where the model might have inadvertently seen
759
+ related medical information during its pre-training, potentially
760
+ overestimating its true ability to generalize to novel medical concepts.
761
+ Developers should validate MedGemma on datasets not publicly available or
762
+ otherwise made available to non-institutional researchers to mitigate this
763
+ risk.
764
+
765
+
766
+ ### Release notes
767
+
768
+ * May 20, 2025: Initial Release
769
+ * July 9, 2025 Bug Fix: Fixed the subtle degradation in the multimodal
770
+ performance. The issue was due to a missing end-of-image token in the model
771
+ vocabulary, impacting combined text-and-image tasks. This fix reinstates and
772
+ correctly maps that token, ensuring text-only tasks remain unaffected while
773
+ restoring multimodal performance.
chat_template.jinja ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}
2
+ {%- if messages[0]['role'] == 'system' -%}
3
+ {%- if messages[0]['content'] is string -%}
4
+ {%- set first_user_prefix = messages[0]['content'] + '
5
+
6
+ ' -%}
7
+ {%- else -%}
8
+ {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
9
+
10
+ ' -%}
11
+ {%- endif -%}
12
+ {%- set loop_messages = messages[1:] -%}
13
+ {%- else -%}
14
+ {%- set first_user_prefix = "" -%}
15
+ {%- set loop_messages = messages -%}
16
+ {%- endif -%}
17
+ {%- for message in loop_messages -%}
18
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
19
+ {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
20
+ {%- endif -%}
21
+ {%- if (message['role'] == 'assistant') -%}
22
+ {%- set role = "model" -%}
23
+ {%- else -%}
24
+ {%- set role = message['role'] -%}
25
+ {%- endif -%}
26
+ {{ '<start_of_turn>' + role + '
27
+ ' + (first_user_prefix if loop.first else "") }}
28
+ {%- if message['content'] is string -%}
29
+ {{ message['content'] | trim }}
30
+ {%- elif message['content'] is iterable -%}
31
+ {%- for item in message['content'] -%}
32
+ {%- if item['type'] == 'image' -%}
33
+ {{ '<start_of_image>' }}
34
+ {%- elif item['type'] == 'text' -%}
35
+ {{ item['text'] | trim }}
36
+ {%- endif -%}
37
+ {%- endfor -%}
38
+ {%- else -%}
39
+ {{ raise_exception("Invalid content type") }}
40
+ {%- endif -%}
41
+ {{ '<end_of_turn>
42
+ ' }}
43
+ {%- endfor -%}
44
+ {%- if add_generation_prompt -%}
45
+ {{'<start_of_turn>model
46
+ '}}
47
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma3Model"
4
+ ],
5
+ "boi_token_index": 255999,
6
+ "eoi_token_index": 256000,
7
+ "eos_token_id": [
8
+ 1,
9
+ 106
10
+ ],
11
+ "image_token_index": 262144,
12
+ "initializer_range": 0.02,
13
+ "mm_tokens_per_image": 256,
14
+ "model_type": "gemma3",
15
+ "quantization_config": {
16
+ "_load_in_4bit": true,
17
+ "_load_in_8bit": false,
18
+ "bnb_4bit_compute_dtype": "bfloat16",
19
+ "bnb_4bit_quant_storage": "uint8",
20
+ "bnb_4bit_quant_type": "nf4",
21
+ "bnb_4bit_use_double_quant": true,
22
+ "llm_int8_enable_fp32_cpu_offload": false,
23
+ "llm_int8_has_fp16_weight": false,
24
+ "llm_int8_skip_modules": null,
25
+ "llm_int8_threshold": 6.0,
26
+ "load_in_4bit": true,
27
+ "load_in_8bit": false,
28
+ "quant_method": "bitsandbytes"
29
+ },
30
+ "text_config": {
31
+ "attention_bias": false,
32
+ "attention_dropout": 0.0,
33
+ "attn_logit_softcapping": null,
34
+ "final_logit_softcapping": null,
35
+ "head_dim": 256,
36
+ "hidden_activation": "gelu_pytorch_tanh",
37
+ "hidden_size": 2560,
38
+ "initializer_range": 0.02,
39
+ "intermediate_size": 10240,
40
+ "layer_types": [
41
+ "sliding_attention",
42
+ "sliding_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "sliding_attention",
46
+ "full_attention",
47
+ "sliding_attention",
48
+ "sliding_attention",
49
+ "sliding_attention",
50
+ "sliding_attention",
51
+ "sliding_attention",
52
+ "full_attention",
53
+ "sliding_attention",
54
+ "sliding_attention",
55
+ "sliding_attention",
56
+ "sliding_attention",
57
+ "sliding_attention",
58
+ "full_attention",
59
+ "sliding_attention",
60
+ "sliding_attention",
61
+ "sliding_attention",
62
+ "sliding_attention",
63
+ "sliding_attention",
64
+ "full_attention",
65
+ "sliding_attention",
66
+ "sliding_attention",
67
+ "sliding_attention",
68
+ "sliding_attention",
69
+ "sliding_attention",
70
+ "full_attention",
71
+ "sliding_attention",
72
+ "sliding_attention",
73
+ "sliding_attention",
74
+ "sliding_attention"
75
+ ],
76
+ "max_position_embeddings": 131072,
77
+ "model_type": "gemma3_text",
78
+ "num_attention_heads": 8,
79
+ "num_hidden_layers": 34,
80
+ "num_key_value_heads": 4,
81
+ "query_pre_attn_scalar": 256,
82
+ "rms_norm_eps": 1e-06,
83
+ "rope_local_base_freq": 10000,
84
+ "rope_scaling": {
85
+ "factor": 8.0,
86
+ "rope_type": "linear"
87
+ },
88
+ "rope_theta": 1000000,
89
+ "sliding_window": 1024,
90
+ "torch_dtype": "bfloat16",
91
+ "use_cache": true,
92
+ "vocab_size": 262208
93
+ },
94
+ "torch_dtype": "bfloat16",
95
+ "transformers_version": "4.53.1",
96
+ "vision_config": {
97
+ "attention_dropout": 0.0,
98
+ "hidden_act": "gelu_pytorch_tanh",
99
+ "hidden_size": 1152,
100
+ "image_size": 896,
101
+ "intermediate_size": 4304,
102
+ "layer_norm_eps": 1e-06,
103
+ "model_type": "siglip_vision_model",
104
+ "num_attention_heads": 16,
105
+ "num_channels": 3,
106
+ "num_hidden_layers": 27,
107
+ "patch_size": 14,
108
+ "torch_dtype": "bfloat16",
109
+ "vision_use_head": false
110
+ }
111
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49ed4f5ac325377134e4975c5481728821cdf5f5c1ad43ff4d7d3b8beb2625cb
3
+ size 3228933505
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_config.json ADDED
The diff for this file is too large to render. See raw diff