MedGemma RoCoV2 โ Standalone Merged Model
This is a fully merged (adapter-free) version of MedGemma fine-tuned on RoCoV2.
The LoRA adapters from LewinRobin/Medgemma_Rocov2 have been merged directly into the base weights of google/medgemma-4b-it.
No PEFT dependency required โ load with plain AutoModelForCausalLM.
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained(
"LewinRobin/Medgemma_ROCOv2_Standalone", torch_dtype=torch.bfloat16, device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("LewinRobin/Medgemma_ROCOv2_Standalone")
messages = [
{"role": "system", "content": "You are a highly experienced radiologist. Given a radiology image identifier and its associated UMLS medical concepts, write an accurate and concise radiology report caption."},
{"role": "user", "content": "Image ID: ROCOv2_2023_train_000001
Medical Concepts (UMLS CUIs): C0040405
Write the radiology report caption for this image."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt", return_token_type_ids=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Training Details
- Base model : google/medgemma-4b-it
- Dataset : StanfordAIMI/rocov2 (~60 k samples)
- Method : QLoRA (merged) โ 4-bit NF4, r=64, alpha=128
- Hardware : NVIDIA H100 80 GB
- Adapter source : LewinRobin/Medgemma_Rocov2
- Downloads last month
- 3
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support