Downloads · 30 days
9
8% of all-time downloads
savinugunarathna/ByT5-Small-fine-tuned
ByT5-Small-fine-tuned is a translation model from savinugunarathna. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
A character-level translation model that converts Singlish (romanized Sinhala mixed with English) to Sinhala script. Built on google/byt5-small using a two-stage training approach.
Downloads · 30 days
9
8% of all-time downloads
All-time downloads
112
Public
Parameters
300M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 100%
From the Hugging Face model README
A character-level translation model that converts Singlish (romanized Sinhala mixed with English) to Sinhala script. Built on google/byt5-small using a two-stage training approach.
This model uses a specialized two-stage training approach to handle both phonetic romanization and shorthand Singlish:
This approach ensures the model handles both formal phonetic romanization AND informal chat-style Singlish.
Hardware & Environment:
Hyperparameters:
from transformers import pipeline
translator = pipeline("translation", model="savinugunarathna/ByT5-Small-fine-tuned")
result = translator("kohomada")
print(result[0]["translation_text"])
# Output: කොහොමද
from transformers import AutoTokenizer, T5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("savinugunarathna/ByT5-Small-fine-tuned")
model = T5ForConditionalGeneration.from_pretrained("savinugunarathna/ByT5-Small-fine-tuned")
# Translate
input_text = "mata badagini"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=80, num_beams=5)
translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(translation)
# Output: මට බඩගිනි
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
model.eval()
while True:
text = input("Enter Singlish (or 'quit'): ")
if text.lower() == 'quit':
break
inputs = tokenizer(text, return_tensors="pt").to(device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=80, num_beams=5)
print(f"Sinhala: {tokenizer.decode(outputs[0], skip_special_tokens=True)}")
| Singlish Input | Sinhala Output | Type |
|---|---|---|
| kohomada | කොහොමද | Phonetic |
| mama hodata innawa | මම හොඳට ඉන්නවා | Phonetic |
| api yamu | අපි යමු | Phonetic |
| oyage nama mokakda | ඔයාගේ නම මොකක්ද | Shorthand |
| api koheda yanne | අපි කොහෙද යන්නේ | Shorthand |
✅ Handles phonetic romanization (standard Latin script representations)
✅ Understands informal Singlish (chat-style abbreviations and variations)
✅ Character-level processing (robust to typos and spelling variations)
✅ No subword tokenization (ByT5's byte-level approach)
Stage 1 - Phonetic Dataset:
Stage 2 - Shorthand Dataset:
Direct training on mixed data can cause interference between formal phonetic patterns and informal shorthand. The two-stage approach:
This ByT5 model differs from mT5 in key ways:
If you use this model, please cite:
@misc{byt5-singlish-sinhala-20260116,
author = {savinugunarathna},
title = {Singlish to Sinhala Translation Model (ByT5-Small)},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/savinugunarathna/ByT5-Small-fine-tuned}}
}
This model uses data from the Swa-bhasha Resource Hub:
@article{sumanathilaka2025swa,
title={Swa-bhasha Resource Hub: Romanized Sinhala to Sinhala Transliteration Systems and Data Resources},
author={Sumanathilaka, Deshan and Perera, Sameera and Dharmasiri, Sachithya and Athukorala, Maneesha and Herath, Anuja Dilrukshi and Dias, Rukshan and Gamage, Pasindu and Weerasinghe, Ruvan and Priyadarshana, YHPP},
journal={arXiv preprint arXiv:2507.09245},
year={2025}
}
Apache 2.0
For questions or issues, please open an issue in the model repository.