CoolFace
Modelpublic

manancode/opus-mt-en-cpp-ctranslate2-android

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes7downloads
README.md57 linesDownload Raw Back to root
1---2license: apache-2.03tags:4- translation5- opus-mt6- ctranslate27- quantized8language:9- multilingual10pipeline_tag: translation11---12 13# opus-mt-en-cpp-ctranslate2-android14 15This is a quantized INT8 version of `Helsinki-NLP/opus-mt-en-cpp` converted to CTranslate2 format for efficient inference.16 17## Model Details18 19- **Original Model**: Helsinki-NLP/opus-mt-en-cpp20- **Format**: CTranslate221- **Quantization**: INT822- **Framework**: OPUS-MT23- **Converted by**: Automated conversion pipeline24 25## Usage26 27### With CTranslate228 29```python30import ctranslate231import sentencepiece as spm32 33# Load the model34translator = ctranslate2.Translator("path/to/model")35 36# Load tokenizers37sp_source = spm.SentencePieceProcessor(model_file="source.spm")38sp_target = spm.SentencePieceProcessor(model_file="target.spm")39 40# Translate41source_tokens = sp_source.encode("Your text here", out_type=str)42results = translator.translate_batch([source_tokens])43translation = sp_target.decode(results[0].hypotheses[0])44```45 46## Performance47 48This INT8 quantized version provides:49- ~75% reduction in model size50- Faster inference speed51- Maintained translation quality52- Mobile-friendly deployment53 54## Original Model55 56Based on the OPUS-MT project: https://github.com/Helsinki-NLP/Opus-MT57