Model Card for medgemma-4b-it-sft-lora-diabetic-retinopathy

This model is a fine-tuned version of google/medgemma-4b-it.

It has been trained using TRL.

The dataset used is from Kaggle Diabetic Retinopathy 224x224 (2019 Data)

Quick start

from transformers import pipeline

SEMANTIC_CLASS_DESCRIPTIONS = [
    "A: No apparent retinopathy (No DR)",
    "B: Mild nonproliferative diabetic retinopathy (Mild NPDR)",
    "C: Moderate nonproliferative diabetic retinopathy (Moderate NPDR)",
    "D: Severe nonproliferative diabetic retinopathy (Severe NPDR)",
    "E: Proliferative diabetic retinopathy (PDR)"
]

options_for_prompt = "\n".join(DR_CLASS_DESCRIPTIONS)
PROMPT = f"Based on the fundus image, what is the stage of diabetic retinopathy?\n{options_for_prompt}"

generator = pipeline("text-generation", model="qizunlee/medgemma-4b-it-sft-lora-diabetic-retinopathy", device="cuda")
output = generator([{"role": "user", "content": PROMPT}], max_new_tokens=40, return_full_text=False)[0]
print(output["generated_text"])

Training procedure

This model was trained with SFT.

Framework versions

  • TRL: 0.17.0
  • Transformers: 4.52.3
  • Pytorch: 2.6.0
  • Datasets: 3.6.0
  • Tokenizers: 0.21.1

Citations

@misc{vonwerra2022trl,
    title        = {{TRL: Transformer Reinforcement Learning}},
    author       = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
    year         = 2020,
    journal      = {GitHub repository},
    publisher    = {GitHub},
    howpublished = {\url{https://github.com/huggingface/trl}}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for qizunlee/medgemma-4b-it-sft-lora-diabetic-retinopathy

Finetuned
(39)
this model