加载中…
加载中…
u-at1 is a compact, decoder-only Transformer designed for Luganda text completion in writing environments. It predicts the next token from text a user has already written, making it suitable for writing assistants, text editors, and applications that provide inline suggestions as users type.
The model uses sliding-window attention to support longer writing sessions while keeping attention computation bounded to a local context. Instead of attending to every token in an entire document, it focuses on a limited window of preceding tokens to predict what comes next.
With approximately 8 million parameters, the model provides a lightweight foundation for integrating Luganda autocomplete into applications where efficient inference and responsive suggestions matter.
This model is designed for autocomplete and text continuation.
| Component | Configuration |
|---|---|
| Architecture | Decoder-only Transformer |
| Parameters | 8,002,644 |
| Vocabulary size | 40,000 |
| Hidden size | 156 |
| Transformer layers | 6 |
| Attention heads | 6 |
| Context window | 256 tokens |
| Attention | Sliding-window attention |
| Positional encoding | Rotary Position Embeddings (RoPE) |
| Feed-forward activation | GELU |
| Input/output embeddings | Tied |
| Framework | PyTorch |
| Integration | Hugging Face Transformers |
The model uses sliding-window attention to bound the attention context during inference. This is useful in writing environments where the text being composed may extend well beyond a single local context window.
As generation proceeds, predictions are conditioned on the preceding context available within the model's attention window.
The 256-token context window describes the local attention context, not a guarantee that the model retains or reasons over every token in a longer document.
The model can be loaded through Hugging Face Transformers using its custom model implementation and tokenizer.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "sagepond/luganda-autocomplete"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True)
model.eval()
prompt = "Mukazi wange yagula "
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=True)
with torch.inference_mode():
logits = model(**inputs).logits
next_token_id = logits[0, -1].argmax().item()
prediction = tokenizer.decode([next_token_id])
print(f"Next-token prediction: {prediction!r}")