You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

English <-> Khmer translation (EmbeddingGemma 2 + NLLB-200, merged)

# pip install sentencepiece
# pip install --no-deps "transformers @ git+https://github.com/huggingface/transformers@92cd495f2720c064bc78eb2d93e28704c5bce51f" "tokenizers>=0.23.1,<0.24" "safetensors>=0.8.0"
# (restart the runtime after installing)
import torch
from transformers import AutoModel

# Check if CUDA (GPU) is available, otherwise default to CPU
device = "cuda" if torch.cuda.is_available() else "cpu"

# Load the model with appropriate dtype and move to the device
model = AutoModel.from_pretrained(
    "cheahour/khmer-translation-v2.2", 
    trust_remote_code=True, 
    torch_dtype=torch.float16 if device == "cuda" else torch.float32
).to(device)

print(model.translate("Where is the nearest hospital?", to="km"))   # English -> Khmer
print(model.translate("សូមអរគុណច្រើន។", to="en"))                    # Khmer -> English

No unsloth, peft or bitsandbytes needed. A GPU is recommended (a free Colab T4 works).

Downloads last month
27
Safetensors
Model size
0.9B params
Tensor type
F32
·
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train cheahour/khmer-translation-v2.2