kimleang123/khmer-text-dataset
Viewer β’ Updated β’ 35k β’ 27 β’ 7
How to use songhieng/khmer-mt5-summarization with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# pip install "transformers<5.0.0"
from transformers import pipeline
pipe = pipeline("summarization", model="songhieng/khmer-mt5-summarization") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("songhieng/khmer-mt5-summarization")
model = AutoModelForSeq2SeqLM.from_pretrained("songhieng/khmer-mt5-summarization", device_map="auto")Abstractive summarization for Khmer (ααααα) text, fine-tuned from google/mt5-small on kimleang123/khmer-text-dataset.
Related models: for inputs longer than 512 tokens use khmer-mt5-summarization-1024tk-V3. For text with repeated passages, use khmer-mt5-summarization-duplicated.
| Base model | google/mt5-small (~300M parameters) |
| Task | Abstractive summarization (seq2seq) |
| Language | Khmer |
| Max input length | 512 tokens |
| Training data | kimleang123/khmer-text-dataset |
| Training hardware | 1Γ NVIDIA Tesla T4 |
| Demo | Khmer Text Summarization Space |
from transformers import pipeline
summarizer = pipeline("summarization", model="songhieng/khmer-mt5-summarization")
text = "ααααα»ααΆααΆααααααΆαααααααΆα α‘α¦ ααΆαααΆαα α αΎαααΆααΊααΆαααααααα
αααααα’αΆαααΈα’αΆααααααα ..."
summary = summarizer(text, max_length=150, min_length=30, num_beams=4)
print(summary[0]["summary_text"])
model.safetensors: the full-precision weights, loaded by from_pretrained. Use this.quantized-khmer-mt5.pth: an experimental quantized PyTorch checkpoint. from_pretrained cannot load it.Built by Songhieng Van. Questions and feedback are welcome in the Community tab.
@misc{van2025khmermt5summarization,
author = {Van, Songhieng},
title = {Khmer mT5 Summarization},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/songhieng/khmer-mt5-summarization}}
}
Base model
google/mt5-small