gemma-3-1b-csw-sft - a model for code-switching and idiomatic rewriting across 37 African languages
2 min read
The model is based on Google Gemma (1B parameters) and handles tasks involving mixing languages in speech (code-switching) and rewriting text rich in local idioms and colloquial expressions. The output provides adapted text with tagged labels for the phrases used. It is designed for developers and researchers working with local datasets and rare language pairs, as well as for stress-testing chatbots.
Key features
- Supports 37 African languages (Yoruba, Hausa, Swahili, Igbo, and others) paired with English, French, and Arabic.
- Capable of mixing languages within text depending on the selected base and secondary language pair.
- Rewrites text in a lively conversational style featuring set expressions and idioms.
- Returns the result with a special tag block listing the idioms or language switches used.
What you can do
- Generate code-switching datasets for training and evaluating chatbots and speech recognition systems.
- Create conversational lines for game characters or dialogues in African languages.
- Test language identification tools and sentiment filters on mixed text.
- Use in educational projects to demonstrate conversational patterns.
Example
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
from huggingface_hub import snapshot_download
repo = "BeardedMonster/gemma-3-1b-csw-sft"
path = snapshot_download(repo, allow_patterns=["*.json", "*.model", "*.jinja", "model.safetensors"])
tok = AutoTokenizer.from_pretrained(path)
llm = LLM(model=path, dtype="bfloat16", max_model_len=2048)Read more
Details• Architecture: based on google/gemma-3-1b-it.
• Metrics: average benchmark score is 48.05 chrF++ (depending on the task).
• Limitations: this is a supervised version that less frequently outputs valid formatting compared to the best version (92% versus 97%+).
• License: free for commercial and non-commercial use with attribution to AletheiaAING.










Comments