Instructions to use ghananlpcommunity/kasawa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ghananlpcommunity/kasawa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ghananlpcommunity/kasawa")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ghananlpcommunity/kasawa") model = AutoModelForCausalLM.from_pretrained("ghananlpcommunity/kasawa") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ghananlpcommunity/kasawa with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ghananlpcommunity/kasawa" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ghananlpcommunity/kasawa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ghananlpcommunity/kasawa
- SGLang
How to use ghananlpcommunity/kasawa with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ghananlpcommunity/kasawa" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ghananlpcommunity/kasawa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ghananlpcommunity/kasawa" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ghananlpcommunity/kasawa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ghananlpcommunity/kasawa with Docker Model Runner:
docker model run hf.co/ghananlpcommunity/kasawa
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ghananlpcommunity/kasawa")
model = AutoModelForCausalLM.from_pretrained("ghananlpcommunity/kasawa")Kasawa — SmolLM2-135M Fine-tuned on Twi
kasawa is a compact Twi language model capable of generating coherent twi text as casual language model. It should be noted that this model serves as a base model and it has not undergone intruction tuning.
Built on SmolLM2-135M and trained on the Pristine Twi Dataset — ~999k rows of clean, naturally sounding Twi text spanning four styles: narrative, dialogue, monologue, and storytelling, grounded in real Ghanaian news topics and named entities.
Try it the yourself in the demo.
Intended Use
This model is released for research and non-profit use only. The primary goal is to lower the barrier for experimentation in the Twi/Akan NLP space — particularly as a base for instruction-tuned models targeting more advanced tasks such as summarization, question answering, and dialogue in Twi.
It can also be very useful as a backbone for LLM-based text-to-speech (TTS) and automatic speech recognition (ASR) systems, as well as machine translation (MT) models involving Twi.
Quick Start
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model = AutoModelForCausalLM.from_pretrained(
"ghananlpcommunity/kasawa",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("ghananlpcommunity/kasawa")
gen = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = "Ɔpɛnimaa bosome, 2025,"
out = gen(prompt, max_new_tokens=200, do_sample=True, temperature=0.65, top_p=0.9)
print(out[0]["generated_text"])
Training Details
| Base model | SmolLM2-135M |
| Dataset | Pristine Twi (~999k rows, ~250M tokens) |
| Epochs | ~2 |
| Hardware | 1× 80GB GPU |
Citation & Community
Created by Mich-Seth Owusu for the Ghana NLP Community.
If you build on this model, please credit the original work and consider sharing
your results back with the community.
License: Research and non-profit use only.
- Downloads last month
- 575
Model tree for ghananlpcommunity/kasawa
Base model
HuggingFaceTB/SmolLM2-135M
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ghananlpcommunity/kasawa")