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 Datasets

Code 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

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.