byt5-khmer-en-alt
561
â
by
Darayut
Language Model
OTHER
New
561 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Training Data Analysis
đľ Good (6.0/10)
Researched training datasets used by byt5-khmer-en-alt with quality assessment
Specialized For
general
multilingual
Training Datasets (1)
c4
đľ 6/10
general
multilingual
Key Strengths
- â˘Scale and Accessibility: 750GB of publicly available, filtered text
- â˘Systematic Filtering: Documented heuristics enable reproducibility
- â˘Language Diversity: Despite English-only, captures diverse writing styles
Considerations
- â˘English-Only: Limits multilingual applications
- â˘Filtering Limitations: Offensive content and low-quality text remain despite filtering
Explore our comprehensive training dataset analysis
View All DatasetsCode Examples
Usagepythontransformers
import torch
import unicodedata
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# 1. Load Model
MODEL_ID = "Darayut/byt5-khmer-en-alt"
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Loading {MODEL_ID}...")
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_ID).to(device)
def translate(text):
# --- PREPROCESSING (Must match training) ---
# 1. Normalize to NFC (Fixes hidden Khmer vowel issues)
# This is crucial for ByT5 as it reads raw bytes.
text = unicodedata.normalize("NFC", text.strip())
# 2. Tokenize
inputs = tokenizer(text, return_tensors="pt").input_ids.to(device)
# 3. Generate
# max_length=128 is usually enough for English sentences
outputs = model.generate(inputs, max_length=384)
# 4. Decode
translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
return translation
# --- Example Usage ---
khmer_text = "áááááśááˇááśáááááááá˘áááááááááśááááááááˇááá
á˘ááˇááááśá
ááá˝á2% áááááśááážááážáááśá1%á"
result = translate(khmer_text)
print(f"Output: {result}")Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.