Run this model with HF Jobs
Run akmaier/medgemma-4b-figcaption-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/akmaier/medgemma-4b-figcaption-lora. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/akmaier/medgemma-4b-figcaption-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/akmaier/medgemma-4b-figcaption-lora. Ask me which benchmark to run, then save the scores and the per-example results to a new private dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/akmaier/medgemma-4b-figcaption-lora. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use akmaier/medgemma-4b-figcaption-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use akmaier/medgemma-4b-figcaption-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Access the MedGemma caption adapters
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
These LoRA adapters are derivatives of google/medgemma-4b-it and are governed by the Gemma Terms of Use and the Health AI Developer Foundations terms. Research and evaluation only, not for clinical use.
Log in or Sign Up to review the conditions and access this model content.
Figure-captioning LoRA adapters (MedGemma-4B)
PEFT LoRA adapters (r=16, alpha=32) fine-tuned on medical figure captions on top of google/medgemma-4b-it.
They accompany a SPIE Medical Imaging study on caption fine-tuning for medical figure captioning, and are
released for research and evaluation only. Not for clinical use. Access is gated because these are Gemma
derivatives (Gemma + Health AI Developer Foundations terms). Manuscript under submission.
Conditions (subfolders; seeds 42/43/44)
c1_raw_s{seed}: fine-tuned on raw figure captions.c2_clean_s{seed}: fine-tuned on cleaned captions.c3_aux_s{seed}: cleaned captions plus an auxiliary content loss.
C0 (zero-shot) is the base model with no adapter.
Loading
from peft import PeftModel
from transformers import AutoModelForImageTextToText
base = AutoModelForImageTextToText.from_pretrained("google/medgemma-4b-it", torch_dtype="bfloat16")
model = PeftModel.from_pretrained(base, "akmaier/medgemma-4b-figcaption-lora", subfolder="c2_clean_s42")
Notes
Trained on medical figure captions from open-access and text-and-data-mining sources (figures only; no captions or images are shipped). Findings: fine-tuning raises content overlap and hallucination together; the auxiliary loss does not help; for this 4B model caption cleaning does not reduce hallucination and instead trims content. The models do not reliably perceive imaging artifacts. For research and evaluation, not for clinical decisions.
- Downloads last month
- -