Downloads · 30 days
12
32% of all-time downloads
electricsheepafrica/chewie-1.2
chewie-1.2 is a text generation model from electricsheepafrica. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
<img src="https://huggingface.co/electricsheepafrica/chewie-1.2/resolve/main/chewie-banner.png" alt="Chewie Banner" width="100%"/
Downloads · 30 days
12
32% of all-time downloads
All-time downloads
38
Public
Repo size
117 MB
Likes
0
Public
Click a slice to open those files.
.safetensors77.1 MB · 65%
From the Hugging Face model README
Chewie 1.2 is a medical AI assistant fine-tuned specifically for Community Health Workers (CHWs) in Africa. Built on Google's MedGemma-4B, it provides structured clinical guidance following a consistent Assessment → Action → Advice format.
Chewie 1.2 is a LoRA adapter fine-tuned on top of google/medgemma-4b-it using a curated dataset of 11,880 multilingual medical conversations designed for community health settings in Africa.
pip install transformers peft bitsandbytes accelerate
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
# Load base model with 4-bit quantization
base_model_id = "google/medgemma-4b-it"
adapter_id = "electricsheepafrica/chewie-1.2"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config=bnb_config,
attn_implementation="eager",
device_map="auto",
)
# Load adapter
model = PeftModel.from_pretrained(base_model, adapter_id)
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
# Generate response
def chat(prompt):
messages = [{"role": "user", "content": prompt}]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
)
return tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
# Example usage
response = chat("What are the danger signs in a child with diarrhea?")
print(response)
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
| LoRA Dropout | 0.05 |
| Target Modules | all-linear |
| Learning Rate | 2e-4 |
| Batch Size | 1-2 |
| Gradient Accumulation | 8-16 |
| Epochs | 1 |
| Precision | bf16/fp16 |
| Optimizer | AdamW (fused) |
| Metric | Value |
|---|---|
| Final Training Loss | 1.08 |
| Final Validation Loss | 1.13 |
| Mean Token Accuracy | 72.5% |
| Training Time | ~1 hour |
Input: "What are the symptoms of malaria?"
Output:
**Assessment:** Malaria can cause various symptoms, including fever, chills,
sweating, headache, muscle aches, nausea, vomiting, and fatigue. In severe
cases, it may lead to anemia, kidney failure, or brain damage.
**Action:** If you or someone you know has a high fever (above 102°F or 39°C),
persistent headaches, or unusual weakness, seek medical help immediately at
a clinic. These could be danger signs for severe malaria.
**Advice:** To prevent malaria, use insect repellent when outdoors, sleep
under mosquito nets, and take preventative medications if recommended by
your healthcare provider.
@misc{chewie-1.2,
author = {Electric Sheep Africa},
title = {Chewie 1.2: African Community Health Worker AI Assistant},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/electricsheepafrica/chewie-1.2}
}