Downloads · 30 days
997
6% of all-time downloads
yacht/byt5-base-en2th-transliterator
byt5-base-en2th-transliterator is a text generation model from yacht. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model transliterates English text to Thai script, converting the sound of English words into Thai characters.
Downloads · 30 days
997
6% of all-time downloads
All-time downloads
16.9K
Public
Parameters
582M
9.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.5 GB · 100%
How the weights are stored.
F16435M · 75%
From the Hugging Face model README
This model transliterates English text to Thai script, converting the sound of English words into Thai characters.
This model is based on ByT5, a token-free sequence-to-sequence model that operates directly on UTF-8 bytes. It has been fine-tuned specifically for English to Thai transliteration using multiple data sources to improve accuracy and coverage.
The model was trained on a combined dataset of English-Thai transliteration pairs from multiple sources. The dataset includes:
google/byt5-base2e-4810AdamW0.78310.05910.4654from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load model and tokenizer
model_name = "yacht/byt5-base-en2th-transliterator"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
# Transliterate English to Thai
english_text = "hello"
inputs = tokenizer(english_text, return_tensors="pt")
outputs = model.generate(inputs.input_ids)
thai_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(f"English: {english_text} → Thai: {thai_text}")
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load model with fp16 for faster inference (requires GPU with CUDA)
model_name = "yacht/byt5-base-en2th-transliterator"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(
model_name,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32
)
# Transliterate English to Thai with fp16
english_text = "hello"
inputs = tokenizer(english_text, return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
outputs = model.generate(inputs.input_ids)
thai_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(f"English: {english_text} → Thai: {thai_text}")
| English | Thai |
|---|---|
| hello | เฮลโล |
| computer | คอมพิวเตอร์ |
| thailand | ไทยแลนด์ |
| bangkok | แบงค็อก |
| graph | กราฟ |
| grossular | กรอสซูลาร์ |
| grossularite | กรอสซูลาไรต์ |
Using FP16 (half-precision) can provide significant performance benefits:
This model was trained on multiple datasets combined together, which provides several advantages:
This model is designed specifically for transliteration, not translation. It attempts to convert the sounds of English words into Thai script, not to provide their Thai translations.
The model's performance may vary based on:
Some common error patterns observed:
MIT License
Copyright (c) 2025 yacht
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.