Downloads · 30 days
12
2% of all-time downloads
Ephraimmm/medgemma-soap-finetuned1
medgemma-soap-finetuned1 is a text generation model from Ephraimmm. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned variant of MedGemma (Google's medical-domain Gemma 3 model family), adapted to draft clinical SOAP notes (Subjective, Objective, Assessment, Plan) from consultation text. It was built on top…
Downloads · 30 days
12
2% of all-time downloads
All-time downloads
519
Public
Parameters
5B
8.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.6 GB · 100%
From the Hugging Face model README
This model is a fine-tuned variant of MedGemma (Google's medical-domain Gemma 3 model family), adapted to draft clinical SOAP notes (Subjective, Objective, Assessment, Plan) from consultation text. It was built on top of unsloth/medgemma-4b-it-unsloth-bnb-4bit, a 4-bit quantized build of google/medgemma-4b-it, and fine-tuned with Unsloth and Hugging Face's TRL library. The goal is to help reduce the clinical documentation burden by structuring free-text encounter notes or transcripts into a standard SOAP format — as a research/portfolio project, not a deployed clinical tool.
The values below are as reported by the model author in the original repository card. No trainer_state.json, evaluation logs, or adapter_config.json are included in the repository, so these figures could not be independently re-derived from raw training artifacts — they are presented here as author-reported metadata rather than independently verified benchmarks.
| Setting | Value |
|---|---|
| Base model | unsloth/medgemma-4b-it-unsloth-bnb-4bit (Unsloth's 4-bit build of google/medgemma-4b-it) |
| Architecture | Gemma3ForConditionalGeneration (Gemma 3 text backbone + SigLIP vision encoder), confirmed in config.json |
| Framework | Unsloth + Hugging Face TRL |
| Fine-tuning method | 4-bit QLoRA |
| LoRA rank | 16 (author-reported) |
| LoRA alpha | 32 (author-reported) |
| Epochs | 3 (author-reported) |
| Effective batch size | 8 (author-reported) |
| Learning rate | 2e-4 (author-reported) |
| LR scheduler | Cosine (author-reported) |
| Final train loss | 0.8076 (author-reported) |
| Final eval loss | 1.0012 (author-reported) |
| License | Apache 2.0 |
| Language | English |
This repository hosts the fully merged model weights (model-00001-of-00002.safetensors, model-00002-of-00002.safetensors) rather than a standalone LoRA adapter — the QLoRA weights described above were merged back into the base model before upload.
This is a research/portfolio project and has not been evaluated or certified as a medical device. It is not intended for direct use in patient care without human clinical oversight, further validation, and regulatory review.
The model uses the standard Gemma 3 chat template (<start_of_turn>user ... <end_of_turn>). Load it with transformers as follows:
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
model_id = "Ephraimmm/medgemma-soap-finetuned1"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{
"role": "user",
"content": [
{"type": "text", "text": (
"Convert the following clinical consultation notes into a SOAP note "
"(Subjective, Objective, Assessment, Plan):\n\n"
"Patient reports a 3-day history of sore throat and low-grade fever. "
"Temp 37.9C, throat erythematous, no exudate. Rapid strep negative. "
"Plan: supportive care, follow up if symptoms worsen."
)}
],
}
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=512)
response = processor.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
print(response)
Note: the base architecture (Gemma3ForConditionalGeneration) supports multimodal image+text input, but this fine-tune was trained and is intended for text-only SOAP note generation.
trainer_state.json and adapter configuration files are not present in this repository, the exact LoRA/training hyperparameters could not be independently confirmed beyond what the author documented.Developed by Ephraimmm