Downloads · 30 days
0
AhmedSSoliman/medgemma-4b-digital-twin-v1
medgemma-4b-digital-twin-v1 is a machine learning model from AhmedSSoliman. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as other.
A fine-tuned medical AI assistant trained using GRPO (Group Relative Policy Optimization) on Google's MedGemma-4b.
Downloads · 30 days
0
Access
Public
Updated Dec 5, 2025
Repo size
300 MB
Likes
0
Public
Click a slice to open those files.
.safetensors262 MB · 87%
From the Hugging Face model README
A fine-tuned medical AI assistant trained using GRPO (Group Relative Policy Optimization) on Google's MedGemma-4b.
This model acts as a Medical Digital Twin - simulating physiological reasoning processes before providing medical responses. It's designed to bridge the gap between patient data and clinical decision-making.
<think> tagsfrom unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="AhmedSSoliman/medgemma-4b-digital-twin-v1",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
# Chat format
messages = [
{"role": "system", "content": [{"type": "text", "text": "You are a Medical Digital Twin AI."}]},
{"role": "user", "content": [{"type": "text", "text": "I have chest pain radiating to my left arm."}]}
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=1024, temperature=0.6)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Input: "I have chest pain radiating to my left arm."
Output:
<think>
This presentation is concerning for acute coronary syndrome (ACS). Classic signs:
- Chest pain with left arm radiation (angina pattern)
- Requires immediate evaluation for myocardial infarction
- Time-sensitive condition requiring emergency protocols
</think>
⚠️ URGENT: These symptoms suggest a possible heart attack. You need immediate medical attention:
1. Call 911 or go to the nearest emergency room NOW
2. Do not drive yourself - have someone drive you or call ambulance
3. If you have aspirin, chew one 325mg tablet while waiting
4. Stay calm and avoid physical exertion
This is a medical emergency requiring immediate professional evaluation with ECG and cardiac biomarkers.
⚠️ Critical Disclaimers:
On medical reasoning test suite:
@misc{medgemma-digital-twin-2024,
author = {AhmedSSoliman},
title = {Medical Digital Twin v1},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/AhmedSSoliman/medgemma-4b-digital-twin-v1}}
}
This model inherits the MedGemma Terms of Use. Please review these terms before use.
For code and training scripts, visit: GitHub Repository