Add files using upload-large-folder tool
Browse files- .gitattributes +8 -0
- README.md +615 -0
- config.json +62 -0
- medgemma-4b-it-Q4_K_M.gguf +3 -0
- medgemma-4b-it-UD-IQ1_S.gguf +3 -0
- medgemma-4b-it-UD-Q2_K_XL.gguf +3 -0
- medgemma-4b-it-UD-Q3_K_XL.gguf +3 -0
- medgemma-4b-it-UD-Q4_K_XL.gguf +3 -0
- medgemma-4b-it-UD-Q5_K_XL.gguf +3 -0
- mmproj-F16.gguf +3 -0
- mmproj-F32.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,11 @@ 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 |
+
mmproj-F16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
medgemma-4b-it-UD-IQ1_S.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
medgemma-4b-it-UD-Q2_K_XL.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
mmproj-F32.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
medgemma-4b-it-UD-Q3_K_XL.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
medgemma-4b-it-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
medgemma-4b-it-UD-Q4_K_XL.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
medgemma-4b-it-UD-Q5_K_XL.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: health-ai-developer-foundations
|
| 4 |
+
license_link: https://developers.google.com/health-ai-developer-foundations/terms
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: image-text-to-text
|
| 7 |
+
extra_gated_heading: Access MedGemma on Hugging Face
|
| 8 |
+
extra_gated_prompt: >-
|
| 9 |
+
To access MedGemma on Hugging Face, you're required to review and
|
| 10 |
+
agree to [Health AI Developer Foundation's terms of use](https://developers.google.com/health-ai-developer-foundations/terms).
|
| 11 |
+
To do this, please ensure you're logged in to Hugging Face and click below.
|
| 12 |
+
Requests are processed immediately.
|
| 13 |
+
extra_gated_button_content: Acknowledge license
|
| 14 |
+
base_model:
|
| 15 |
+
- google/medgemma-4b-it
|
| 16 |
+
tags:
|
| 17 |
+
- medical
|
| 18 |
+
- unsloth
|
| 19 |
+
- radiology
|
| 20 |
+
- clinical-reasoning
|
| 21 |
+
- dermatology
|
| 22 |
+
- pathology
|
| 23 |
+
- ophthalmology
|
| 24 |
+
- chest-x-ray
|
| 25 |
+
---
|
| 26 |
+
<div>
|
| 27 |
+
<p style="margin-top: 0;margin-bottom: 0;">
|
| 28 |
+
<em><a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>
|
| 29 |
+
</p>
|
| 30 |
+
<div style="display: flex; gap: 5px; align-items: center; ">
|
| 31 |
+
<a href="https://github.com/unslothai/unsloth/">
|
| 32 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
|
| 33 |
+
</a>
|
| 34 |
+
<a href="https://discord.gg/unsloth">
|
| 35 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
| 36 |
+
</a>
|
| 37 |
+
<a href="https://docs.unsloth.ai/basics/qwen3-how-to-run-and-fine-tune">
|
| 38 |
+
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
| 39 |
+
</a>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
# MedGemma model card
|
| 45 |
+
|
| 46 |
+
**Model documentation:** [MedGemma](https://developers.google.com/health-ai-developer-foundations/medgemma)
|
| 47 |
+
|
| 48 |
+
**Resources:**
|
| 49 |
+
|
| 50 |
+
* Model on Google Cloud Model Garden: [MedGemma](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/medgemma)
|
| 51 |
+
* Model on Hugging Face: [MedGemma](https://huggingface.co/collections/google/medgemma-release-680aade845f90bec6a3f60c4)
|
| 52 |
+
* GitHub repository (supporting code, Colab notebooks, discussions, and
|
| 53 |
+
issues): [MedGemma](https://github.com/google-health/medgemma)
|
| 54 |
+
* Quick start notebook: [GitHub](https://github.com/google-health/medgemma/blob/main/notebooks/quick_start_with_hugging_face.ipynb)
|
| 55 |
+
* Fine-tuning notebook: [GitHub](https://github.com/google-health/medgemma/blob/main/notebooks/fine_tune_with_hugging_face.ipynb)
|
| 56 |
+
* [Patient Education Demo built using MedGemma](https://huggingface.co/spaces/google/rad_explain)
|
| 57 |
+
* Support: See [Contact](https://developers.google.com/health-ai-developer-foundations/medgemma/get-started.md#contact)
|
| 58 |
+
* License: The use of MedGemma is governed by the [Health AI Developer
|
| 59 |
+
Foundations terms of
|
| 60 |
+
use](https://developers.google.com/health-ai-developer-foundations/terms).
|
| 61 |
+
|
| 62 |
+
**Author:** Google
|
| 63 |
+
|
| 64 |
+
## Model information
|
| 65 |
+
|
| 66 |
+
This section describes the MedGemma model and how to use it.
|
| 67 |
+
|
| 68 |
+
### Description
|
| 69 |
+
|
| 70 |
+
MedGemma is a collection of [Gemma 3](https://ai.google.dev/gemma/docs/core)
|
| 71 |
+
variants that are trained for performance on medical text and image
|
| 72 |
+
comprehension. Developers can use MedGemma to accelerate building
|
| 73 |
+
healthcare-based AI applications. MedGemma currently comes in two variants: a 4B
|
| 74 |
+
multimodal version and a 27B text-only version.
|
| 75 |
+
|
| 76 |
+
MedGemma 4B utilizes a [SigLIP](https://arxiv.org/abs/2303.15343) image encoder
|
| 77 |
+
that has been specifically pre-trained on a variety of de-identified medical
|
| 78 |
+
data, including chest X-rays, dermatology images, ophthalmology images, and
|
| 79 |
+
histopathology slides. Its LLM component is trained on a diverse set of medical
|
| 80 |
+
data, including radiology images, histopathology patches, ophthalmology images,
|
| 81 |
+
and dermatology images.
|
| 82 |
+
|
| 83 |
+
MedGemma 4B is available in both pre-trained (suffix: `-pt`) and
|
| 84 |
+
instruction-tuned (suffix `-it`) versions. The instruction-tuned version is a
|
| 85 |
+
better starting point for most applications. The pre-trained version notably
|
| 86 |
+
achieves better performance on MIMIC-style chest X-ray reporting.
|
| 87 |
+
|
| 88 |
+
MedGemma 27B has been trained exclusively on medical text and optimized for
|
| 89 |
+
inference-time computation. MedGemma 27B is only available as an
|
| 90 |
+
instruction-tuned model.
|
| 91 |
+
|
| 92 |
+
MedGemma variants have been evaluated on a range of clinically relevant
|
| 93 |
+
benchmarks to illustrate their baseline performance. These include both open
|
| 94 |
+
benchmark datasets and curated datasets. Developers can fine-tune MedGemma
|
| 95 |
+
variants for improved performance. Consult the Intended Use section below for
|
| 96 |
+
more details.
|
| 97 |
+
|
| 98 |
+
A full technical report will be available soon.
|
| 99 |
+
|
| 100 |
+
### How to use
|
| 101 |
+
|
| 102 |
+
Below are some example code snippets to help you quickly get started running the
|
| 103 |
+
model locally on GPU. If you want to use the model at scale, we recommend that
|
| 104 |
+
you create a production version using [Model
|
| 105 |
+
Garden](https://cloud.google.com/model-garden).
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
First, install the Transformers library. Gemma 3 is supported starting from
|
| 109 |
+
transformers 4.50.0.
|
| 110 |
+
|
| 111 |
+
```sh
|
| 112 |
+
$ pip install -U transformers
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
First, install the Transformers library. Gemma 3 is supported starting from
|
| 116 |
+
transformers 4.50.0.
|
| 117 |
+
|
| 118 |
+
```sh
|
| 119 |
+
$ pip install -U transformers
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
**Run model with the `pipeline` API**
|
| 123 |
+
|
| 124 |
+
```python
|
| 125 |
+
from transformers import pipeline
|
| 126 |
+
from PIL import Image
|
| 127 |
+
import requests
|
| 128 |
+
import torch
|
| 129 |
+
|
| 130 |
+
pipe = pipeline(
|
| 131 |
+
"image-text-to-text",
|
| 132 |
+
model="google/medgemma-4b-it",
|
| 133 |
+
torch_dtype=torch.bfloat16,
|
| 134 |
+
device="cuda",
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
|
| 138 |
+
image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
|
| 139 |
+
image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
|
| 140 |
+
|
| 141 |
+
messages = [
|
| 142 |
+
{
|
| 143 |
+
"role": "system",
|
| 144 |
+
"content": [{"type": "text", "text": "You are an expert radiologist."}]
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"role": "user",
|
| 148 |
+
"content": [
|
| 149 |
+
{"type": "text", "text": "Describe this X-ray"}
|
| 150 |
+
{"type": "image", "image": image},
|
| 151 |
+
]
|
| 152 |
+
}
|
| 153 |
+
]
|
| 154 |
+
|
| 155 |
+
output = pipe(text=messages, max_new_tokens=200)
|
| 156 |
+
print(output[0]["generated_text"][-1]["content"])
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
**Run the model directly**
|
| 160 |
+
|
| 161 |
+
```python
|
| 162 |
+
# pip install accelerate
|
| 163 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 164 |
+
from PIL import Image
|
| 165 |
+
import requests
|
| 166 |
+
import torch
|
| 167 |
+
|
| 168 |
+
model_id = "google/medgemma-4b-it"
|
| 169 |
+
|
| 170 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 171 |
+
model_id,
|
| 172 |
+
torch_dtype=torch.bfloat16,
|
| 173 |
+
device_map="auto",
|
| 174 |
+
)
|
| 175 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 176 |
+
|
| 177 |
+
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
|
| 178 |
+
image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
|
| 179 |
+
image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
|
| 180 |
+
|
| 181 |
+
messages = [
|
| 182 |
+
{
|
| 183 |
+
"role": "system",
|
| 184 |
+
"content": [{"type": "text", "text": "You are an expert radiologist."}]
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"role": "user",
|
| 188 |
+
"content": [
|
| 189 |
+
{"type": "text", "text": "Describe this X-ray"},
|
| 190 |
+
{"type": "image", "image": image}
|
| 191 |
+
]
|
| 192 |
+
}
|
| 193 |
+
]
|
| 194 |
+
|
| 195 |
+
inputs = processor.apply_chat_template(
|
| 196 |
+
messages, add_generation_prompt=True, tokenize=True,
|
| 197 |
+
return_dict=True, return_tensors="pt"
|
| 198 |
+
).to(model.device, dtype=torch.bfloat16)
|
| 199 |
+
|
| 200 |
+
input_len = inputs["input_ids"].shape[-1]
|
| 201 |
+
|
| 202 |
+
with torch.inference_mode():
|
| 203 |
+
generation = model.generate(**inputs, max_new_tokens=200, do_sample=False)
|
| 204 |
+
generation = generation[0][input_len:]
|
| 205 |
+
|
| 206 |
+
decoded = processor.decode(generation, skip_special_tokens=True)
|
| 207 |
+
print(decoded)
|
| 208 |
+
```
|
| 209 |
+
|
| 210 |
+
### Examples
|
| 211 |
+
|
| 212 |
+
See the following Colab notebooks for examples of how to use MedGemma:
|
| 213 |
+
|
| 214 |
+
* To give the model a quick try, running it locally with weights from Hugging
|
| 215 |
+
Face, see [Quick start notebook in
|
| 216 |
+
Colab](https://colab.research.google.com/github/google-health/medgemma/blob/main/notebooks/quick_start_with_hugging_face.ipynb). Note that you will need to use Colab
|
| 217 |
+
Enterprise to run the 27B model without quantization.
|
| 218 |
+
|
| 219 |
+
* For an example of fine-tuning the model, see the [Fine-tuning notebook in
|
| 220 |
+
Colab](https://colab.research.google.com/github/google-health/medgemma/blob/main/notebooks/fine_tune_with_hugging_face.ipynb).
|
| 221 |
+
|
| 222 |
+
### Model architecture overview
|
| 223 |
+
|
| 224 |
+
The MedGemma model is built based on [Gemma 3](https://ai.google.dev/gemma/) and
|
| 225 |
+
uses the same decoder-only transformer architecture as Gemma 3. To read more
|
| 226 |
+
about the architecture, consult the Gemma 3 [model
|
| 227 |
+
card](https://ai.google.dev/gemma/docs/core/model_card_3).
|
| 228 |
+
|
| 229 |
+
### Technical specifications
|
| 230 |
+
|
| 231 |
+
* **Model type**: Decoder-only Transformer architecture, see the [Gemma 3
|
| 232 |
+
technical
|
| 233 |
+
report](https://storage.googleapis.com/deepmind-media/gemma/Gemma3Report.pdf)
|
| 234 |
+
* **Modalities**: **4B**: Text, vision; **27B**: Text only
|
| 235 |
+
* **Attention mechanism**: Utilizes grouped-query attention (GQA)
|
| 236 |
+
* **Context length**: Supports long context, at least 128K tokens
|
| 237 |
+
* **Key publication**: Coming soon
|
| 238 |
+
* **Model created**: May 20, 2025
|
| 239 |
+
* **Model version**: 1.0.0
|
| 240 |
+
|
| 241 |
+
### Citation
|
| 242 |
+
|
| 243 |
+
A technical report is coming soon. In the meantime, if you publish using this
|
| 244 |
+
model, please cite the Hugging Face model page:
|
| 245 |
+
|
| 246 |
+
```none
|
| 247 |
+
@misc{medgemma-hf,
|
| 248 |
+
author = {Google},
|
| 249 |
+
title = {MedGemma Hugging Face}
|
| 250 |
+
howpublished = {\url{https://huggingface.co/collections/google/medgemma-release-680aade845f90bec6a3f60c4}},
|
| 251 |
+
year = {2025},
|
| 252 |
+
note = {Accessed: [Insert Date Accessed, e.g., 2025-05-20]}
|
| 253 |
+
}
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
### Inputs and outputs
|
| 257 |
+
|
| 258 |
+
**Input**:
|
| 259 |
+
|
| 260 |
+
* Text string, such as a question or prompt
|
| 261 |
+
* Images, normalized to 896 x 896 resolution and encoded to 256 tokens each
|
| 262 |
+
* Total input length of 128K tokens
|
| 263 |
+
|
| 264 |
+
**Output**:
|
| 265 |
+
|
| 266 |
+
* Generated text in response to the input, such as an answer to a question,
|
| 267 |
+
analysis of image content, or a summary of a document
|
| 268 |
+
* Total output length of 8192 tokens
|
| 269 |
+
|
| 270 |
+
### Performance and validation
|
| 271 |
+
|
| 272 |
+
MedGemma was evaluated across a range of different multimodal classification,
|
| 273 |
+
report generation, visual question answering, and text-based tasks.
|
| 274 |
+
|
| 275 |
+
### Key performance metrics
|
| 276 |
+
|
| 277 |
+
#### Imaging evaluations
|
| 278 |
+
|
| 279 |
+
The multimodal performance of MedGemma 4B was evaluated across a range of
|
| 280 |
+
benchmarks, focusing on radiology, dermatology, histopathology, ophthalmology,
|
| 281 |
+
and multimodal clinical reasoning.
|
| 282 |
+
|
| 283 |
+
MedGemma 4B outperforms the base Gemma 3 4B model across all tested multimodal
|
| 284 |
+
health benchmarks.
|
| 285 |
+
|
| 286 |
+
| Task and metric | MedGemma 4B | Gemma 3 4B |
|
| 287 |
+
| :---- | :---- | :---- |
|
| 288 |
+
| **Medical image classification** | | |
|
| 289 |
+
| MIMIC CXR \- Average F1 for top 5 conditions | 88.9 | 81.1 |
|
| 290 |
+
| CheXpert CXR \- Average F1 for top 5 conditions | 48.1 | 31.2 |
|
| 291 |
+
| DermMCQA\* \- Accuracy | 71.8 | 42.6 |
|
| 292 |
+
| **Visual question answering** | | |
|
| 293 |
+
| SlakeVQA (radiology) \- Tokenized F1 | 62.3 | 38.6 |
|
| 294 |
+
| VQA-Rad\*\* (radiology) \- Tokenized F1 | 49.9 | 38.6 |
|
| 295 |
+
| PathMCQA (histopathology, internal\*\*\*) \- Accuracy | 69.8 | 37.1 |
|
| 296 |
+
| **Knowledge and reasoning** | | |
|
| 297 |
+
| MedXpertQA (text \+ multimodal questions) \- Accuracy | 18.8 | 16.4 |
|
| 298 |
+
|
| 299 |
+
*Based on [ref](https://www.nature.com/articles/s41591-020-0842-3), presented as
|
| 300 |
+
a 4-way MCQ per example for skin condition classification.
|
| 301 |
+
|
| 302 |
+
**On balanced split, see [ref](https://arxiv.org/pdf/2405.03162).
|
| 303 |
+
|
| 304 |
+
***Based on multiple datasets, presented as 3-9 way MCQ per example for
|
| 305 |
+
identification, grading, and subtype for breast, cervical, and prostate cancer.
|
| 306 |
+
|
| 307 |
+
#### Chest X-ray report generation
|
| 308 |
+
|
| 309 |
+
MedGemma chest X-ray (CXR) report generation performance was evaluated on
|
| 310 |
+
[MIMIC-CXR](https://physionet.org/content/mimic-cxr/2.1.0/) using the [RadGraph
|
| 311 |
+
F1 metric](https://arxiv.org/abs/2106.14463). We compare the MedGemma
|
| 312 |
+
pre-trained checkpoint with our previous best model for CXR report generation,
|
| 313 |
+
[PaliGemma 2](https://arxiv.org/abs/2412.03555).
|
| 314 |
+
|
| 315 |
+
| Metric | MedGemma 4B (pre-trained) | PaliGemma 2 3B (tuned for CXR) | PaliGemma 2 10B (tuned for CXR) |
|
| 316 |
+
| :---- | :---- | :---- | :---- |
|
| 317 |
+
| **Chest X-ray report generation** | | | |
|
| 318 |
+
| MIMIC CXR \- RadGraph F1 | 29.5 | 28.8 | 29.5 |
|
| 319 |
+
|
| 320 |
+
The instruction-tuned versions of MedGemma 4B and Gemma 3 4B achieve lower
|
| 321 |
+
scores (0.22 and 0.12, respectively) due to the differences in reporting style
|
| 322 |
+
compared to the MIMIC ground truth reports. Further fine-tuning on MIMIC reports
|
| 323 |
+
will enable users to achieve improved performance.
|
| 324 |
+
|
| 325 |
+
#### Text evaluations
|
| 326 |
+
|
| 327 |
+
MedGemma 4B and text-only MedGemma 27B were evaluated across a range of
|
| 328 |
+
text-only benchmarks for medical knowledge and reasoning.
|
| 329 |
+
|
| 330 |
+
The MedGemma models outperform their respective base Gemma models across all
|
| 331 |
+
tested text-only health benchmarks.
|
| 332 |
+
|
| 333 |
+
| Metric | MedGemma 27B | Gemma 3 27B | MedGemma 4B | Gemma 3 4B |
|
| 334 |
+
| :---- | :---- | :---- | :---- | :---- |
|
| 335 |
+
| MedQA (4-op) | 89.8 (best-of-5) 87.7 (0-shot) | 74.9 | 64.4 | 50.7 |
|
| 336 |
+
| MedMCQA | 74.2 | 62.6 | 55.7 | 45.4 |
|
| 337 |
+
| PubMedQA | 76.8 | 73.4 | 73.4 | 68.4 |
|
| 338 |
+
| MMLU Med (text only) | 87.0 | 83.3 | 70.0 | 67.2 |
|
| 339 |
+
| MedXpertQA (text only) | 26.7 | 15.7 | 14.2 | 11.6 |
|
| 340 |
+
| AfriMed-QA | 84.0 | 72.0 | 52.0 | 48.0 |
|
| 341 |
+
|
| 342 |
+
For all MedGemma 27B results, [test-time
|
| 343 |
+
scaling](https://arxiv.org/abs/2501.19393) is used to improve performance.
|
| 344 |
+
|
| 345 |
+
### Ethics and safety evaluation
|
| 346 |
+
|
| 347 |
+
#### Evaluation approach
|
| 348 |
+
|
| 349 |
+
Our evaluation methods include structured evaluations and internal red-teaming
|
| 350 |
+
testing of relevant content policies. Red-teaming was conducted by a number of
|
| 351 |
+
different teams, each with different goals and human evaluation metrics. These
|
| 352 |
+
models were evaluated against a number of different categories relevant to
|
| 353 |
+
ethics and safety, including:
|
| 354 |
+
|
| 355 |
+
* **Child safety**: Evaluation of text-to-text and image-to-text prompts
|
| 356 |
+
covering child safety policies, including child sexual abuse and
|
| 357 |
+
exploitation.
|
| 358 |
+
* **Content safety:** Evaluation of text-to-text and image-to-text prompts
|
| 359 |
+
covering safety policies, including harassment, violence and gore, and hate
|
| 360 |
+
speech.
|
| 361 |
+
* **Representational harms**: Evaluation of text-to-text and image-to-text
|
| 362 |
+
prompts covering safety policies, including bias, stereotyping, and harmful
|
| 363 |
+
associations or inaccuracies.
|
| 364 |
+
* **General medical harms:** Evaluation of text-to-text and image-to-text
|
| 365 |
+
prompts covering safety policies, including information quality and harmful
|
| 366 |
+
associations or inaccuracies.
|
| 367 |
+
|
| 368 |
+
In addition to development level evaluations, we conduct "assurance evaluations"
|
| 369 |
+
which are our "arms-length" internal evaluations for responsibility governance
|
| 370 |
+
decision making. They are conducted separately from the model development team,
|
| 371 |
+
to inform decision making about release. High-level findings are fed back to the
|
| 372 |
+
model team, but prompt sets are held out to prevent overfitting and preserve the
|
| 373 |
+
results' ability to inform decision making. Notable assurance evaluation results
|
| 374 |
+
are reported to our Responsibility & Safety Council as part of release review.
|
| 375 |
+
|
| 376 |
+
#### Evaluation results
|
| 377 |
+
|
| 378 |
+
For all areas of safety testing, we saw safe levels of performance across the
|
| 379 |
+
categories of child safety, content safety, and representational harms. All
|
| 380 |
+
testing was conducted without safety filters to evaluate the model capabilities
|
| 381 |
+
and behaviors. For text-to-text, image-to-text, and audio-to-text, and across
|
| 382 |
+
both MedGemma model sizes, the model produced minimal policy violations. A
|
| 383 |
+
limitation of our evaluations was that they included primarily English language
|
| 384 |
+
prompts.
|
| 385 |
+
|
| 386 |
+
## Data card
|
| 387 |
+
|
| 388 |
+
### Dataset overview
|
| 389 |
+
|
| 390 |
+
#### Training
|
| 391 |
+
|
| 392 |
+
The base Gemma models are pre-trained on a large corpus of text and code data.
|
| 393 |
+
MedGemma 4B utilizes a [SigLIP](https://arxiv.org/abs/2303.15343) image encoder
|
| 394 |
+
that has been specifically pre-trained on a variety of de-identified medical
|
| 395 |
+
data, including radiology images, histopathology images, ophthalmology images,
|
| 396 |
+
and dermatology images. Its LLM component is trained on a diverse set of medical
|
| 397 |
+
data, including medical text relevant to radiology images, chest-x rays,
|
| 398 |
+
histopathology patches, ophthalmology images and dermatology images.
|
| 399 |
+
|
| 400 |
+
#### Evaluation
|
| 401 |
+
|
| 402 |
+
MedGemma models have been evaluated on a comprehensive set of clinically
|
| 403 |
+
relevant benchmarks, including over 22 datasets across 5 different tasks and 6
|
| 404 |
+
medical image modalities. These include both open benchmark datasets and curated
|
| 405 |
+
datasets, with a focus on expert human evaluations for tasks like CXR report
|
| 406 |
+
generation and radiology VQA.
|
| 407 |
+
|
| 408 |
+
#### Source
|
| 409 |
+
|
| 410 |
+
MedGemma utilizes a combination of public and private datasets.
|
| 411 |
+
|
| 412 |
+
This model was trained on diverse public datasets including MIMIC-CXR (chest
|
| 413 |
+
X-rays and reports), Slake-VQA (multimodal medical images and questions),
|
| 414 |
+
PAD-UFES-20 (skin lesion images and data), SCIN (dermatology images), TCGA
|
| 415 |
+
(cancer genomics data), CAMELYON (lymph node histopathology images), PMC-OA
|
| 416 |
+
(biomedical literature with images), and Mendeley Digital Knee X-Ray (knee
|
| 417 |
+
X-rays).
|
| 418 |
+
|
| 419 |
+
Additionally, multiple diverse proprietary datasets were licensed and
|
| 420 |
+
incorporated (described next).
|
| 421 |
+
|
| 422 |
+
### Data Ownership and Documentation
|
| 423 |
+
|
| 424 |
+
* [Mimic-CXR](https://physionet.org/content/mimic-cxr/2.1.0/): MIT Laboratory
|
| 425 |
+
for Computational Physiology and Beth Israel Deaconess Medical Center
|
| 426 |
+
(BIDMC).
|
| 427 |
+
* [Slake-VQA](https://www.med-vqa.com/slake/): The Hong Kong Polytechnic
|
| 428 |
+
University (PolyU), with collaborators including West China Hospital of
|
| 429 |
+
Sichuan University and Sichuan Academy of Medical Sciences / Sichuan
|
| 430 |
+
Provincial People's Hospital.
|
| 431 |
+
* [PAD-UFES-20](https://pmc.ncbi.nlm.nih.gov/articles/PMC7479321/): Federal
|
| 432 |
+
University of Espírito Santo (UFES), Brazil, through its Dermatological and
|
| 433 |
+
Surgical Assistance Program (PAD).
|
| 434 |
+
* [SCIN](https://github.com/google-research-datasets/scin): A collaboration
|
| 435 |
+
between Google Health and Stanford Medicine.
|
| 436 |
+
* [TCGA](https://portal.gdc.cancer.gov/) (The Cancer Genome Atlas): A joint
|
| 437 |
+
effort of National Cancer Institute and National Human Genome Research
|
| 438 |
+
Institute. Data from TCGA are available via the Genomic Data Commons (GDC)
|
| 439 |
+
* [CAMELYON](https://camelyon17.grand-challenge.org/Data/): The data was
|
| 440 |
+
collected from Radboud University Medical Center and University Medical
|
| 441 |
+
Center Utrecht in the Netherlands.
|
| 442 |
+
* [PMC-OA (PubMed Central Open Access
|
| 443 |
+
Subset)](https://catalog.data.gov/dataset/pubmed-central-open-access-subset-pmc-oa):
|
| 444 |
+
Maintained by the National Library of Medicine (NLM) and National Center for
|
| 445 |
+
Biotechnology Information (NCBI), which are part of the NIH.
|
| 446 |
+
* [MedQA](https://arxiv.org/pdf/2009.13081): This dataset was created by a
|
| 447 |
+
team of researchers led by Di Jin, Eileen Pan, Nassim Oufattole, Wei-Hung
|
| 448 |
+
Weng, Hanyi Fang, and Peter Szolovits
|
| 449 |
+
* [Mendeley Digital Knee
|
| 450 |
+
X-Ray](https://data.mendeley.com/datasets/t9ndx37v5h/1): This dataset is
|
| 451 |
+
from Rani Channamma University, and is hosted on Mendeley Data.
|
| 452 |
+
* [AfriMed-QA](https://afrimedqa.com/): This data was developed and led by
|
| 453 |
+
multiple collaborating organizations and researchers include key
|
| 454 |
+
contributors: Intron Health, SisonkeBiotik, BioRAMP, Georgia Institute of
|
| 455 |
+
Technology, and MasakhaneNLP.
|
| 456 |
+
* [VQA-RAD](https://www.nature.com/articles/sdata2018251): This dataset was
|
| 457 |
+
created by a research team led by Jason J. Lau, Soumya Gayen, Asma Ben
|
| 458 |
+
Abacha, and Dina Demner-Fushman and their affiliated institutions (the US
|
| 459 |
+
National Library of Medicine and National Institutes of Health)
|
| 460 |
+
* [MedExpQA](https://www.sciencedirect.com/science/article/pii/S0933365724001805):
|
| 461 |
+
This dataset was created by researchers at the HiTZ Center (Basque Center
|
| 462 |
+
for Language Technology and Artificial Intelligence).
|
| 463 |
+
* [MedXpertQA](https://huggingface.co/datasets/TsinghuaC3I/MedXpertQA): This
|
| 464 |
+
dataset was developed by researchers at Tsinghua University (Beijing, China)
|
| 465 |
+
and Shanghai Artificial Intelligence Laboratory (Shanghai, China).
|
| 466 |
+
|
| 467 |
+
In addition to the public datasets listed above, MedGemma was also trained on
|
| 468 |
+
de-identified datasets licensed for research or collected internally at Google
|
| 469 |
+
from consented participants.
|
| 470 |
+
|
| 471 |
+
* Radiology dataset 1: De-identified dataset of different CT studies across
|
| 472 |
+
body parts from a US-based radiology outpatient diagnostic center network.
|
| 473 |
+
* Ophthalmology dataset 1: De-identified dataset of fundus images from
|
| 474 |
+
diabetic retinopathy screening.
|
| 475 |
+
* Dermatology dataset 1: De-identified dataset of teledermatology skin
|
| 476 |
+
condition images (both clinical and dermatoscopic) from Colombia.
|
| 477 |
+
* Dermatology dataset 2: De-identified dataset of skin cancer images (both
|
| 478 |
+
clinical and dermatoscopic) from Australia.
|
| 479 |
+
* Dermatology dataset 3: De-identified dataset of non-diseased skin images
|
| 480 |
+
from an internal data collection effort.
|
| 481 |
+
* Pathology dataset 1: De-identified dataset of histopathology H&E whole slide
|
| 482 |
+
images created in collaboration with an academic research hospital and
|
| 483 |
+
biobank in Europe. Comprises de-identified colon, prostate, and lymph nodes.
|
| 484 |
+
* Pathology dataset 2: De-identified dataset of lung histopathology H&E and
|
| 485 |
+
IHC whole slide images created by a commercial biobank in the United States.
|
| 486 |
+
* Pathology dataset 3: De-identified dataset of prostate and lymph node H&E
|
| 487 |
+
and IHC histopathology whole slide images created by a contract research
|
| 488 |
+
organization in the United States.
|
| 489 |
+
* Pathology dataset 4: De-identified dataset of histopathology, predominantly
|
| 490 |
+
H\&E whole slide images created in collaboration with a large, tertiary
|
| 491 |
+
teaching hospital in the United States. Comprises a diverse set of tissue
|
| 492 |
+
and stain types, predominantly H&E.
|
| 493 |
+
|
| 494 |
+
### Data citation
|
| 495 |
+
|
| 496 |
+
* MIMIC-CXR Johnson, A., Pollard, T., Mark, R., Berkowitz, S., & Horng, S.
|
| 497 |
+
(2024). MIMIC-CXR Database (version 2.1.0). PhysioNet.
|
| 498 |
+
* Johnson, A.E.W., Pollard, T.J., Berkowitz, S.J. et al. [MIMIC-CXR, a
|
| 499 |
+
de-identified publicly available database of chest radiographs with
|
| 500 |
+
free-text reports. Sci Data 6, 317
|
| 501 |
+
(2019).](https://doi.org/10.1038/s41597-019-0322-0)
|
| 502 |
+
* Available on Physionet Goldberger, A., Amaral, L., Glass, L., Hausdorff, J.,
|
| 503 |
+
Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). [PhysioBank,
|
| 504 |
+
PhysioToolkit, and PhysioNet: Components of a new research resource for
|
| 505 |
+
complex physiologic signals. Circulation \[Online\]. 101 (23), pp.
|
| 506 |
+
E215–e220.](https://pubmed.ncbi.nlm.nih.gov/10851218/)
|
| 507 |
+
* Bo Liu, Li-Ming Zhan, etc. [SLAKE: A Semantically-Labeled Knowledge-Enhanced
|
| 508 |
+
Dataset for Medical Visual Question
|
| 509 |
+
Answering](https://arxiv.org/abs/2102.09542).
|
| 510 |
+
* [PAD-UFES-20: A skin lesion dataset composed of patient data and clinical
|
| 511 |
+
images collected from
|
| 512 |
+
smartphones](https://pmc.ncbi.nlm.nih.gov/articles/PMC7479321/)
|
| 513 |
+
* [The Cancer Genome Atlas Program (TCGA)](https://www.cancer.gov/ccg/research/genome-sequencing/tcga)
|
| 514 |
+
* Babak Ehteshami Bejnordi, etc.: [Diagnostic Assessment of Deep Learning
|
| 515 |
+
Algorithms for Detection of Lymph Node Metastases in Women With Breast
|
| 516 |
+
Cancer](https://jamanetwork.com/journals/jama/fullarticle/2665774)
|
| 517 |
+
* MedQA: [https://arxiv.org/abs/2009.13081](https://arxiv.org/abs/2009.13081)
|
| 518 |
+
* Mendeley Digital Knee X-Ray: Gornale, Shivanand; Patravali, Pooja (2020),
|
| 519 |
+
"Digital Knee X-ray Images", Mendeley Data, V1, doi: 10.17632/t9ndx37v5h.1
|
| 520 |
+
* AfriMed-QA: [https://arxiv.org/abs/2411.15640](https://arxiv.org/abs/2411.15640)
|
| 521 |
+
* VQA-RAD: [Lau, J., Gayen, S., Ben Abacha, A. et al. A dataset of clinically
|
| 522 |
+
generated visual questions and answers about radiology images. Sci Data 5,
|
| 523 |
+
180251 (2018).
|
| 524 |
+
https://doi.org/10.1038/sdata.2018.251](https://doi.org/10.1038/sdata.2018.251)
|
| 525 |
+
* [MedExpQA: Multilingual benchmarking of Large Language Models for
|
| 526 |
+
Medical Question
|
| 527 |
+
Answering](https://www.sciencedirect.com/science/article/pii/S0933365724001805)
|
| 528 |
+
* MedXpertQA: [arXiv:2501.18362v2](https://arxiv.org/abs/2501.18362)
|
| 529 |
+
|
| 530 |
+
### De-identification/anonymization:
|
| 531 |
+
|
| 532 |
+
Google and partnerships utilize datasets that have been rigorously anonymized or
|
| 533 |
+
de-identified to ensure the protection of individual research participants and
|
| 534 |
+
patient privacy
|
| 535 |
+
|
| 536 |
+
## Implementation information
|
| 537 |
+
|
| 538 |
+
Details about the model internals.
|
| 539 |
+
|
| 540 |
+
### Software
|
| 541 |
+
|
| 542 |
+
Training was done using [JAX](https://github.com/jax-ml/jax).
|
| 543 |
+
|
| 544 |
+
JAX allows researchers to take advantage of the latest generation of hardware,
|
| 545 |
+
including TPUs, for faster and more efficient training of large models.
|
| 546 |
+
|
| 547 |
+
## Use and limitations
|
| 548 |
+
|
| 549 |
+
### Intended use
|
| 550 |
+
|
| 551 |
+
MedGemma is an open multimodal generative AI model intended to be used as a
|
| 552 |
+
starting point that enables more efficient development of downstream healthcare
|
| 553 |
+
applications involving medical text and images. MedGemma is intended for
|
| 554 |
+
developers in the life sciences and healthcare space. Developers are responsible
|
| 555 |
+
for training, adapting and making meaningful changes to MedGemma to accomplish
|
| 556 |
+
their specific intended use. MedGemma models can be fine-tuned by developers
|
| 557 |
+
using their own proprietary data for their specific tasks or solutions.
|
| 558 |
+
|
| 559 |
+
MedGemma is based on Gemma 3 and has been further trained on medical images and
|
| 560 |
+
text. MedGemma enables further development in any medical context (image and
|
| 561 |
+
textual), however the model was pre-trained using chest X-ray, pathology,
|
| 562 |
+
dermatology, and fundus images. Examples of tasks within MedGemma's training
|
| 563 |
+
include visual question answering pertaining to medical images, such as
|
| 564 |
+
radiographs, or providing answers to textual medical questions. Full details of
|
| 565 |
+
all the tasks MedGemma has been evaluated can be found in an upcoming technical
|
| 566 |
+
report.
|
| 567 |
+
|
| 568 |
+
### Benefits
|
| 569 |
+
|
| 570 |
+
* Provides strong baseline medical image and text comprehension for models of
|
| 571 |
+
its size.
|
| 572 |
+
* This strong performance makes it efficient to adapt for downstream
|
| 573 |
+
healthcare-based use cases, compared to models of similar size without
|
| 574 |
+
medical data pre-training.
|
| 575 |
+
* This adaptation may involve prompt engineering, grounding, agentic
|
| 576 |
+
orchestration or fine-tuning depending on the use case, baseline validation
|
| 577 |
+
requirements, and desired performance characteristics.
|
| 578 |
+
|
| 579 |
+
### Limitations
|
| 580 |
+
|
| 581 |
+
MedGemma is not intended to be used without appropriate validation, adaptation
|
| 582 |
+
and/or making meaningful modification by developers for their specific use case.
|
| 583 |
+
The outputs generated by MedGemma are not intended to directly inform clinical
|
| 584 |
+
diagnosis, patient management decisions, treatment recommendations, or any other
|
| 585 |
+
direct clinical practice applications. Performance benchmarks highlight baseline
|
| 586 |
+
capabilities on relevant benchmarks, but even for image and text domains that
|
| 587 |
+
constitute a substantial portion of training data, inaccurate model output is
|
| 588 |
+
possible. All outputs from MedGemma should be considered preliminary and require
|
| 589 |
+
independent verification, clinical correlation, and further investigation
|
| 590 |
+
through established research and development methodologies.
|
| 591 |
+
|
| 592 |
+
MedGemma's multimodal capabilities have been primarily evaluated on single-image
|
| 593 |
+
tasks. MedGemma has not been evaluated in use cases that involve comprehension
|
| 594 |
+
of multiple images.
|
| 595 |
+
|
| 596 |
+
MedGemma has not been evaluated or optimized for multi-turn applications.
|
| 597 |
+
|
| 598 |
+
MedGemma's training may make it more sensitive to the specific prompt used than
|
| 599 |
+
Gemma 3.
|
| 600 |
+
|
| 601 |
+
When adapting MedGemma developer should consider the following:
|
| 602 |
+
|
| 603 |
+
* **Bias in validation data:** As with any research, developers should ensure
|
| 604 |
+
that any downstream application is validated to understand performance using
|
| 605 |
+
data that is appropriately representative of the intended use setting for
|
| 606 |
+
the specific application (e.g., age, sex, gender, condition, imaging device,
|
| 607 |
+
etc).
|
| 608 |
+
* **Data contamination concerns**: When evaluating the generalization
|
| 609 |
+
capabilities of a large model like MedGemma in a medical context, there is a
|
| 610 |
+
risk of data contamination, where the model might have inadvertently seen
|
| 611 |
+
related medical information during its pre-training, potentially
|
| 612 |
+
overestimating its true ability to generalize to novel medical concepts.
|
| 613 |
+
Developers should validate MedGemma on datasets not publicly available or
|
| 614 |
+
otherwise made available to non-institutional researchers to mitigate this
|
| 615 |
+
risk.
|
config.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma3ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"boi_token_index": 255999,
|
| 6 |
+
"bos_token_id": 2,
|
| 7 |
+
"eoi_token_index": 256000,
|
| 8 |
+
"eos_token_id": 106,
|
| 9 |
+
"image_token_index": 262144,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"mm_tokens_per_image": 256,
|
| 12 |
+
"model_type": "gemma3",
|
| 13 |
+
"pad_token_id": 0,
|
| 14 |
+
"text_config": {
|
| 15 |
+
"attention_bias": false,
|
| 16 |
+
"attention_dropout": 0.0,
|
| 17 |
+
"attn_logit_softcapping": null,
|
| 18 |
+
"cache_implementation": "hybrid",
|
| 19 |
+
"final_logit_softcapping": null,
|
| 20 |
+
"head_dim": 256,
|
| 21 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 22 |
+
"hidden_size": 2560,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 10240,
|
| 25 |
+
"max_position_embeddings": 131072,
|
| 26 |
+
"model_type": "gemma3_text",
|
| 27 |
+
"num_attention_heads": 8,
|
| 28 |
+
"num_hidden_layers": 34,
|
| 29 |
+
"num_key_value_heads": 4,
|
| 30 |
+
"query_pre_attn_scalar": 256,
|
| 31 |
+
"rms_norm_eps": 1e-06,
|
| 32 |
+
"rope_local_base_freq": 10000,
|
| 33 |
+
"rope_scaling": {
|
| 34 |
+
"factor": 8.0,
|
| 35 |
+
"rope_type": "linear"
|
| 36 |
+
},
|
| 37 |
+
"rope_theta": 1000000,
|
| 38 |
+
"sliding_window": 1024,
|
| 39 |
+
"sliding_window_pattern": 6,
|
| 40 |
+
"torch_dtype": "bfloat16",
|
| 41 |
+
"use_cache": true,
|
| 42 |
+
"vocab_size": 262208
|
| 43 |
+
},
|
| 44 |
+
"torch_dtype": "bfloat16",
|
| 45 |
+
"transformers_version": "4.51.3",
|
| 46 |
+
"unsloth_fixed": true,
|
| 47 |
+
"vision_config": {
|
| 48 |
+
"attention_dropout": 0.0,
|
| 49 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 50 |
+
"hidden_size": 1152,
|
| 51 |
+
"image_size": 896,
|
| 52 |
+
"intermediate_size": 4304,
|
| 53 |
+
"layer_norm_eps": 1e-06,
|
| 54 |
+
"model_type": "siglip_vision_model",
|
| 55 |
+
"num_attention_heads": 16,
|
| 56 |
+
"num_channels": 3,
|
| 57 |
+
"num_hidden_layers": 27,
|
| 58 |
+
"patch_size": 14,
|
| 59 |
+
"torch_dtype": "bfloat16",
|
| 60 |
+
"vision_use_head": false
|
| 61 |
+
}
|
| 62 |
+
}
|
medgemma-4b-it-Q4_K_M.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d20114e538b9f6d465a6714b66b976c2c030da84e54ad7954d661e54776f8fd
|
| 3 |
+
size 2489894688
|
medgemma-4b-it-UD-IQ1_S.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08bbb7b02ba93281174dd73805929b27e020bee68f240ce6344ff160da1b400f
|
| 3 |
+
size 1183392288
|
medgemma-4b-it-UD-Q2_K_XL.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:590696274e816516b51ec64d55b3b07c57761db9c0260e5b9aa29791bbe43682
|
| 3 |
+
size 1769408288
|
medgemma-4b-it-UD-Q3_K_XL.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3c03805d9fffeedfb25f9e222b4e55312489ec9fc8d123fdafa8ebfbae5a68e
|
| 3 |
+
size 2150930208
|
medgemma-4b-it-UD-Q4_K_XL.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e33ef732d920302c8e5809372353071a2491d954e9acfe573f829570cd38deb3
|
| 3 |
+
size 2544289568
|
medgemma-4b-it-UD-Q5_K_XL.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fffb55390d3b9d43692fd4f47c0ce1e182869d4d4d282791cdebf5f5f3e580a0
|
| 3 |
+
size 2836231968
|
mmproj-F16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:13913a7e70893b09c40154cbd43456611ea58f12bfe1e5d4ad5b7e4875644dc3
|
| 3 |
+
size 851252128
|
mmproj-F32.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:836b783aa529eb59aaac11663b0eaacd09ac0b6fb4f86e4e96ec13319fed9018
|
| 3 |
+
size 1673393056
|