Skip to content

Commit 9fb764a

Browse files
authored
Register MedGemma, MedSigLIP Presets to kerashub (#2450)
* Register MedGemma, MedSigLIP Presets to kerashub * Address gemini comments * Add siglip preset mapping
1 parent 164c221 commit 9fb764a

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

keras_hub/src/models/gemma3/gemma3_presets.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,43 @@
181181
},
182182
"kaggle_handle": "kaggle://keras/gemma3/keras/gemma3_instruct_270m/4",
183183
},
184+
"medgemma_instruct_4b": {
185+
"metadata": {
186+
"description": (
187+
"A 4 billion parameter model based on Gemma 3. "
188+
"This model is trained for performance on medical text"
189+
"and image comprehension and is optimized for medical"
190+
"applications that involve a text generation component."
191+
),
192+
"params": 4300079472,
193+
"path": "gemma3",
194+
},
195+
"kaggle_handle": "kaggle://keras/medgemma/keras/medgemma_instruct_4b/1",
196+
},
197+
"medgemma_instruct_27b": {
198+
"metadata": {
199+
"description": (
200+
"A 27 billion parameter model based on Gemma 3. "
201+
"This model trained for performance on medical text "
202+
"and image comprehension and is optimized for medical "
203+
"applications that involve a text generation component."
204+
),
205+
"params": 27432406640,
206+
"path": "gemma3",
207+
},
208+
"kaggle_handle": "kaggle://keras/medgemma/keras/medgemma_instruct_27b/1",
209+
},
210+
"medgemma_instruct_27b_text": {
211+
"metadata": {
212+
"description": (
213+
"A 27 billion parameter text-only model based on Gemma 3. "
214+
"This model is trained for performance on medical text "
215+
"comprehension and is optimized for medical applications "
216+
"that involve a text generation component."
217+
),
218+
"params": 27009002240,
219+
"path": "gemma3",
220+
},
221+
"kaggle_handle": "kaggle://keras/medgemma/keras/medgemma_instruct_27b_text/1",
222+
},
184223
}

keras_hub/src/models/siglip/siglip_presets.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,19 @@
321321
},
322322
"kaggle_handle": "kaggle://keras/siglip/keras/siglip2_so400m_patch16_512/1",
323323
},
324+
"medsiglip_900m_448": {
325+
"metadata": {
326+
"description": (
327+
"A 900 million parameter variant of SigLIP trained to encode "
328+
"medical images and text into a common embedding space. "
329+
"MedSigLIP contains a vision encoder and a text encoder, and "
330+
"supports 448x448 image resolution with up to 64 text tokens."
331+
),
332+
"params": 878301426,
333+
"official_name": "SigLIP2",
334+
"path": "siglip",
335+
"model_card": "https://huggingface.co/google/medsiglip-448#medsiglip-model-card",
336+
},
337+
"kaggle_handle": "kaggle://keras/medsiglip/keras/medsiglip_900m_448/1",
338+
},
324339
}

tools/checkpoint_conversion/convert_siglip_checkpoints.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"siglip2_so400m_patch16_256": "google/siglip2-so400m-patch16-256",
111111
"siglip2_so400m_patch16_384": "google/siglip2-so400m-patch16-384",
112112
"siglip2_so400m_patch16_512": "google/siglip2-so400m-patch16-512",
113+
"medsiglip_900m_448": "google/medsiglip-448",
113114
}
114115

115116
flags.DEFINE_string(

0 commit comments

Comments
 (0)