Instructions to use harsaas/medgemma_retraining_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use harsaas/medgemma_retraining_v2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/medgemma-1.5-4b-it") model = PeftModel.from_pretrained(base_model, "harsaas/medgemma_retraining_v2") - Notebooks
- Google Colab
- Kaggle
EyePACS MedGemma language-only LoRA v2
Research demo only. Not clinically validated. Trained with assistant-only loss
and a frozen vision tower. Run mode: full. This model card does not claim
clinical accuracy or independent validation of generated lesion descriptions.
Review training_metadata.json for package versions, base revision, validation
loss, and before/after generation samples. A low loss is not proof of correctness.
Loading
Use the same pinned Transformers 4.57.6 and PEFT 0.21.2 environment used in training. Accept the base model's access terms and authenticate with Hugging Face first. This is a LoRA adapter, not a standalone model. For a CUDA GPU:
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor, BitsAndBytesConfig
from peft import PeftConfig, PeftModel
adapter_id = "harsaas/medgemma_retraining_v2"
config = PeftConfig.from_pretrained(adapter_id)
processor = AutoProcessor.from_pretrained(adapter_id)
base = AutoModelForImageTextToText.from_pretrained(
config.base_model_name_or_path,
revision=config.revision,
torch_dtype=torch.float16,
device_map={"": 0},
quantization_config=BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True,
),
)
model = PeftModel.from_pretrained(base, adapter_id, device_map={"": 0})
model.eval()
Do not treat generated findings as established facts or use them for patient care. The base-model license/access restrictions and dataset terms still apply.
- Downloads last month
- 3
Model tree for harsaas/medgemma_retraining_v2
Base model
google/medgemma-1.5-4b-it