Instructions to use iamfae/medgemma-maternal-lora-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use iamfae/medgemma-maternal-lora-v2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/medgemma-4b-it-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "iamfae/medgemma-maternal-lora-v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Model Card for medgemma-maternal-lora-v2
Version 2 of a LoRA adapter for MedGemma 4B that adapts it to maternal and reproductive health information in seven languages used in Zimbabwe and Zambia. Compared with v1, v2 adds clinician-reviewed question-and-answer data drawn from documents, a contraception seed set, and real user conversations from Dawa Health's assistant. It is intended for research and development of multilingual maternal health assistants. It is not a medical device and does not replace a health professional.
Model Details
Model Description
This is a QLoRA adapter trained on top of MedGemma 4B (instruction-tuned). Training of v2 continued from the v1 adapter (no new LoRA layers were added), so v2 is a single adapter that loads on the base model exactly like v1. It was trained on text only. The base model's image capabilities were not trained and have not been evaluated here.
- Developed by: Dawa Health
- Funded by: UNICEF
- Shared by: Dawa Health
- Model type: LoRA adapter (QLoRA) for a decoder-only multimodal language model, used for text generation
- Language(s) (NLP): English, Shona, Ndebele, Tonga, Chinyanja (Nyanja), Bemba, Lozi
- License: Dawa Health's contributions are released under the GNU Affero General Public License v3.0 (AGPL-3.0). The adapter is also derived from MedGemma, so the Health AI Developer Foundations terms continue to apply. See the License section.
- Finetuned from model: google/medgemma-4b-it, via the v1 adapter (dawahealth/medgemma-maternal-lora)
Model Sources
- Website: https://dawa-health.com/
Uses
Direct Use
Research and development of multilingual, code-switched maternal health information assistants, for example answering questions about what to expect in a given week of pregnancy, cervical cancer, fertility, contraception and common antenatal concerns. Outputs should be reviewed by clinicians before being shown to patients.
Downstream Use
Integration into a chat assistant such as Dawa Health's WhatsApp assistant (Rudo), with retrieval of vetted guideline content and human review for sensitive cases.
Out-of-Scope Use
- Diagnosis, triage of emergencies, or treatment decisions.
- Medication or dosing advice.
- Replacing a clinician, midwife or community health worker.
- General-purpose assistance unrelated to maternal and reproductive health (the model can drift off-topic, for example giving generic career advice when asked about employment).
- Use in any language, region or clinical setting that has not been validated by local clinicians.
- Any use that violates the Health AI Developer Foundations terms of use or the AGPL-3.0.
Bias, Risks, and Limitations
- Incorrect clinical content. In evaluation, at least one English answer was clinically wrong (it said a urinary tract infection in pregnancy makes the baby's heart rate drop and bacteria settle in the baby's lungs, whereas untreated UTIs mainly risk spreading to the kidneys and causing complications). Overlap scores do not detect errors like this. The model can state wrong information confidently.
- Repetition loops. With greedy decoding, the model sometimes repeats the same phrase until it hits the token limit. In the evaluation this affected 17 of 133 answers, mostly in Bemba (8 of 14), Chinyanja, Lozi and Shona. Use a repetition penalty at inference (see below).
- Minority-language quality is unverified and uneven. Output in Shona, Chinyanja and Bemba is weak for free-text answers. Higher scores in Ndebele, Tonga and Lozi are partly explained by short, repeated stock lines in the reference text being reproduced exactly, not by fluent generation of new content. Output in every language has not been reviewed by native speakers.
- Language coverage differs by task. Shona, Ndebele and Tonga were trained on pregnancy week guides only, with no question-and-answer examples, so conversational behavior in those languages is expected to be weaker. Cervical cancer FAQs exist for English, Bemba, Chinyanja and Lozi only. The new v2 data (document Q&A, contraception, real conversations) is mainly English.
- Gaps in the source material. The training material may not cover locally important topics. For example, malaria prevention, HIV testing and preeclampsia were not found in the Bemba guide. Do not rely on the model for these topics.
- Possible memorization of user text. Real user conversations were included in training and repeated three times. Do not assume the model cannot reproduce fragments of them. [Confirm that personal identifiers were removed before training.]
- If used with an assistant that acts on special keywords (for example to hand over to a human agent), the model can emit or omit those keywords incorrectly. Test these flows before deployment.
- The model was not trained on prices, product lists or personal data, and should not be used as a source for them.
Recommendations
Keep a human in the loop. Ground answers in vetted, source-tagged guideline content, and have clinicians who speak each language test the model on realistic, code-switched questions before any patient-facing use. Use a repetition penalty (for example repetition_penalty=1.15) when generating. Users, both direct and downstream, should be made aware of the risks, biases and limitations above.
How to Get Started with the Model
The base model is gated: accept the MedGemma terms on Hugging Face first.
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
from peft import PeftModel
BASE = "google/medgemma-4b-it"
ADAPTER = "dawahealth/medgemma-maternal-lora-v2"
processor = AutoProcessor.from_pretrained(BASE)
model = AutoModelForImageTextToText.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, ADAPTER)
SYSTEM = ("You are a maternal health assistant. Answer in the same language and mixing of languages "
"the person uses. Give clear, supportive guidance, and tell the person to go to a clinic or "
"hospital right away if there are danger signs.")
question = "Your question here"
prompt = f"<start_of_turn>user\n{SYSTEM}\n\n{question}<end_of_turn>\n<start_of_turn>model\n"
inputs = processor(text=prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=250, do_sample=False, repetition_penalty=1.15)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
With Unsloth:
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained("dawahealth/medgemma-maternal-lora-v2", load_in_4bit=True)
Training Details
Training Data
Text from Dawa Health's maternal health materials, kept as written by the authors and converted to chat-format examples. v2 mixes four sources:
- Original guides and FAQs (replay, from v1). Pregnancy week guides, 40 weeks each, in English, Shona, Ndebele, Tonga, Chinyanja, Bemba and Lozi, split into sections (overview, body changes, baby development, tips, planning, and things to avoid where present). Cervical cancer FAQs in English, Bemba, Chinyanja and Lozi. All non-English rows were mixed back in to reduce forgetting, and no English rows from this set were replayed because the new data covers English.
- Reviewed question-and-answer pairs from documents (
qa_drafts_sft.jsonl). - A contraception seed Q&A set (
seed_contraception_qa_sft.jsonl). - Real user conversations from Dawa Health's WhatsApp assistant (
rudo_conversations_sft.jsonl), repeated three times in training to give them more weight.
All rows were pooled, shuffled and split 95/5: 95% for training and 5% held out for evaluation.
The Bemba guide was prepared with native-speaker doctors. English terms inside the local-language text were intentionally kept because speakers code-switch.
Training Procedure
Preprocessing
Examples were converted to Gemma chat turns with a short system prompt. For the week guides the user turn is the week heading plus the section heading taken from the same file. For FAQs and Q&A the user turn is the question. About 5 percent of examples were held out for validation, and the split was made before repeating conversation rows so repeated rows cannot leak into validation.
Training Hyperparameters
- Training regime: QLoRA (4-bit base weights, fp16 compute on a T4 GPU), using Unsloth and TRL
- Continued from the v1 adapter: LoRA rank 16, alpha 16, dropout 0, applied to attention and MLP modules of the language model (vision layers frozen)
- Learning rate 5e-5 (lower than v1 because an existing adapter was being continued), linear schedule, 5 warmup steps, AdamW 8-bit, weight decay 0.01
- Per-device batch size 1 with gradient accumulation 8 (effective batch size 8), 1 epoch
- Maximum sequence length 1024
- Loss computed on the model's answer only
- Seed 3407
Speeds, Sizes, Times
Approximately 10 GPU hours on a single NVIDIA T4.
Evaluation
Testing Data, Factors & Metrics
Testing Data
Held-out examples from the 5% evaluation split (rows were split 95/5 for training and evaluation). Two samples from that split were scored:
- Three-model comparison: 48 questions, 6 per group, answered by the base model (
google/medgemma-4b-it), the v1 adapter and the v2 adapter. - Larger v2-only sample: 133 questions (up to 40 per group).
The split is random by row, so neighboring rows from the same document or conversation can appear on both sides. It is not a test set of unseen documents. Because v2 was continued from v1, which was trained on an earlier split of the original guides and FAQs, some held-out guide and FAQ rows may already have been seen by v1 and carried into v2, so the guide and FAQ scores can be inflated. The real-conversation and document Q&A groups were not in v1's training data, so they give the cleanest v1 vs v2 comparison.
Factors
Language and source type: real conversations (reviewed), document Q&A (unreviewed), and original guides/FAQs by language.
Metrics
Sentence-level chrF between the model's greedy-decoded answer and the single reference answer. chrF measures character overlap, not correctness: a correct answer worded differently scores low, and a wrong answer that reuses reference wording can score high. Answers were also checked for repetition loops (the same words repeated until the token limit). Held-out loss and perplexity are not reported.
Results
Three-model comparison (48 questions, mean chrF)
| Group | n per model | Base | v1 | v2 |
|---|---|---|---|---|
| Real conversations (reviewed) | 6 | 38.5 | 8.5 | 47.3 |
| Document Q&A (unreviewed) | 6 | 30.9 | 22.5 | 37.4 |
| Ndebele (guides/FAQs) | 6 | 7.1 | 66.7 | 68.6 |
| Lozi (guides/FAQs) | 6 | 6.2 | 50.2 | 66.2 |
| Tonga (guides/FAQs) | 6 | 6.9 | 46.5 | 55.3 |
| Chinyanja (guides/FAQs) | 6 | 11.7 | 23.0 | 24.7 |
| Bemba (guides/FAQs) | 6 | 11.9 | 14.3 | 19.3 |
| Shona (guides/FAQs) | 6 | 11.9 | 17.7 | 19.4 |
| Overall | 48 | 15.6 | 31.2 | 42.3 |
Median chrF was 11.1 (base), 18.4 (v1) and 34.3 (v2). Answers that looped: 11 of 48 for base, 11 of 48 for v1 and 5 of 48 for v2.
Larger v2-only sample (133 questions, mean chrF)
| Group | n | Mean chrF |
|---|---|---|
| Ndebele (guides/FAQs) | 9 | 65.8 |
| Tonga (guides/FAQs) | 16 | 49.7 |
| Real conversations | 9 | 39.7 |
| Lozi (guides/FAQs) | 18 | 36.3 |
| Document Q&A | 40 | 33.0 |
| Chinyanja (guides/FAQs) | 17 | 24.0 |
| Shona (guides/FAQs) | 10 | 24.0 |
| Bemba (guides/FAQs) | 14 | 20.0 |
| Overall | 133 | 34.9 (median 29.7) |
Group sizes are small (6 to 40), so one or two answers move a group mean by several points. Treat these numbers as directional. The overall score is lower on the larger sample than on the 48-question sample, so the 42.3 should not be read as typical performance.
Summary
- v2 improves on v1 in every group, and the largest gains are on English, where v1 gave short, generic answers (real conversations 8.5 to 47.3). v2 also scores above the base model in English, on real conversations (47.3 vs 38.5) and on document Q&A (37.4 vs 30.9).
- The base model fails in the local languages (6.2 to 11.9 chrF). v1 and v2 learn them, and v2 is best, but Shona, Bemba and Chinyanja stay weak (19.3 to 24.7).
- Short stock lines inflate some scores. Among non-English guide/FAQ rows in the 133-row sample, answers with references under 150 characters average 43.2 chrF, and those with longer references average 21.1. The model reproduces short, repeated lines well, but does not yet write long new content reliably in these languages.
- Repetition loops remain, mainly in Bemba and Shona, and in 17 of 133 answers in the larger sample.
- At least one English answer was clinically wrong despite a reasonable score (it said a urinary tract infection in pregnancy makes the baby's heart rate drop and bacteria settle in the baby's lungs).
- Validation on held-out examples measures how well the model learned the training materials, not how it performs on real user questions. A clinician-reviewed evaluation on realistic, code-switched questions has not yet been completed.
License
This adapter is open source with a share-alike (copyleft) requirement.
- Dawa Health's contributions (the adapter weights, training code, evaluation code and this documentation) are licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
- What that means in practice: if you modify this adapter or build a work based on it and distribute it, or let people interact with it over a network (for example through a chat assistant, WhatsApp bot, web app or API), you must make the corresponding source of your work available to those users under the AGPL-3.0. The network clause is what extends this to hosted solutions.
- MedGemma terms still apply. This adapter is a derivative of google/medgemma-4b-it, which is governed by the Health AI Developer Foundations terms of use, including its use restrictions. You must comply with both sets of terms. Where they conflict, the base model's terms govern the parts derived from MedGemma, and the AGPL-3.0 does not remove or relax them.
- Not legal advice. How copyleft applies to model weights and model outputs is not settled law. If you plan to build a commercial product on this adapter, get your own legal advice.
The full AGPL-3.0 text is available at https://www.gnu.org/licenses/agpl-3.0.en.html.
Contributing
We welcome contributions. The adapter is only as good as the review it receives, and the most valuable help is from people who know the languages and the clinical setting.
Ways to help:
- Native-speaker review of outputs in Shona, Ndebele, Tonga, Chinyanja, Bemba and Lozi, especially fluency and code-switching.
- Clinician review of answers on pregnancy danger signs, cervical cancer, contraception, fertility and postnatal care, including reports of incorrect or unsafe answers.
- Better evaluation: held-out test sets split by document or conversation, and clinician-rated metrics.
- Data: reviewed question-and-answer pairs in the supported languages, or in new ones. Please only contribute material you have the right to share, and never include personal or patient information.
- Fixes and improvements to the training and evaluation code.
How to contribute: open a discussion or pull request on this repository's Community tab, or email hello@dawa-health.com. By contributing, you agree that your contribution is licensed under the same terms as this project (AGPL-3.0, subject to the MedGemma terms above).
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: NVIDIA T4 GPU
- Hours used: 10
- Cloud Provider: Google Colab
Technical Specifications
Model Architecture and Objective
LoRA adapter on MedGemma 4B (Gemma 3 4B based). Objective: next-token prediction on answer tokens.
Compute Infrastructure
Hardware
Single NVIDIA T4 GPU (free-tier Google Colab).
Software
Unsloth, TRL, PEFT, Transformers, bitsandbytes, sacrebleu (evaluation).
Citation
If you use this adapter, please cite it and also cite MedGemma.
BibTeX:
@misc{dawahealth2026medgemmamaternal,
author = {{Dawa Health}},
title = {MedGemma Maternal Health LoRA (v2): a multilingual adapter for maternal and reproductive health information},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/dawahealth/medgemma-maternal-lora-v2}},
note = {Funded by UNICEF. Licensed under AGPL-3.0, subject to the Health AI Developer Foundations terms}
}
@article{sellergren2025medgemma,
title = {MedGemma Technical Report},
author = {Sellergren, Andrew and others},
journal = {arXiv preprint arXiv:2507.05201},
year = {2025}
}
APA:
Dawa Health. (2026). MedGemma Maternal Health LoRA (v2) [Model]. Hugging Face. https://huggingface.co/dawahealth/medgemma-maternal-lora-v2
More Information
Dawa Health is a maternal and women's health platform operating in Zimbabwe and Zambia.
Model Card Authors
Dawa Health
Model Card Contact
- Downloads last month
- 20