Downloads · 30 days
11
16% of all-time downloads
arumpuri/medgemma-4b-debe-specialist
medgemma-4b-debe-specialist is a machine learning model from arumpuri. 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 peft. The card lists the license as apache-2.0.
Fine-tuned MedGemma 4B-IT for bilingual dengue triage (English + Indonesian).
Downloads · 30 days
11
16% of all-time downloads
All-time downloads
69
Public
Repo size
153 MB
Likes
0
Public
Click a slice to open those files.
.safetensors119 MB · 78%
From the Hugging Face model README
Fine-tuned MedGemma 4B-IT for bilingual dengue triage (English + Indonesian).
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
# Load base model
base_model_id = "google/medgemma-4b-it"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# Strip vision tower
if hasattr(model, 'vision_tower'):
delattr(model, 'vision_tower')
if hasattr(model, 'multi_modal_projector'):
delattr(model, 'multi_modal_projector')
if hasattr(model, 'model'):
if hasattr(model.model, 'vision_tower'):
delattr(model.model, 'vision_tower')
if hasattr(model.model, 'multi_modal_projector'):
delattr(model.model, 'multi_modal_projector')
# Load LoRA adapters
model = PeftModel.from_pretrained(model, "arumpuri/medgemma-4b-debe-specialist")
model.eval()
# Prepare input
prompt = """Analyze this dengue case and provide triage recommendation:
Patient: 35 year old Female, Day 5 of illness
Fever: 38.8°C, Headache: 6/10
Platelets: 75000/μL (severity score: 2)
HCT: 46%, WBC: 3500/μL
WHO Risk Score: 7/15, Warning signs: 2
Provide assessment in English, then translate to Indonesian."""
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=False
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
inputs['token_type_ids'] = torch.zeros_like(inputs['input_ids'])
# Generate
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=300,
temperature=0.3,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
result = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
print(result)
| Test Case | Unique Words | Status |
|---|---|---|
| Severe Dengue | 39 | ✅ PASS |
| Warning Signs | 36 | ✅ PASS |
| Mild Case | 40 | ✅ PASS |
@misc{debe2026,
title={DeBe: Bilingual Dengue Triage Specialist},
author={MedGemma Impact Challenge 2026},
year={2026}
}
Apache 2.0