Upload folder using huggingface_hub
Browse filesFiles changed (13)
- README.mdAdded+105
- config.jsonAdded+10
- model.binAdded+3
- pytorch_model/averaged_model.safetensorsAdded+3
- pytorch_model/config.yamlAdded+51
- pytorch_model/tokenizer_src.modelAdded+3
- pytorch_model/tokenizer_src.vocabAdded
- pytorch_model/tokenizer_tgt.modelAdded+3
- pytorch_model/tokenizer_tgt.vocabAdded
- source_vocabulary.jsonAdded
- src.spm.modelAdded+3
- target_vocabulary.jsonAdded
- tgt.spm.modelAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105---language:- uk- entags:- translationlicense: cc-by-4.0datasets:- quickmt/quickmt-train.uk-en- quickmt/finetranslations-sample-uk-en- HuggingFaceFW/finetranslationsmodel-index:- name: quickmt-uk-en results: - task: name: Translation ukr-eng type: translation args: ukr-eng dataset: name: flores101-devtest type: flores_101 args: ukr_Cyrl eng_Latn devtest metrics: - name: BLEU type: bleu value: 39.88 - name: CHRF type: chrf value: 65.65
---
# `quickmt-uk-en` Neural Machine Translation Model
`quickmt-uk-en` is a reasonably fast and reasonably accurate neural machine translation model for translation from `uk` into `en`.
`quickmt` models are roughly 3 times faster for GPU inference than OpusMT models and roughly [40 times](https://huggingface.co/spaces/quickmt/quickmt-vs-libretranslate) faster than [LibreTranslate](https://huggingface.co/spaces/quickmt/quickmt-vs-libretranslate)/[ArgosTranslate](github.com/argosopentech/argos-translate).
## Try it on our Huggingface Space
Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-Demo
## Model Information
* Trained using [`quickmt-train`](github.com/quickmt/quickmt-train) * 200M parameter seq2seq transformer* 32k separate Sentencepiece vocabs* Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format* The pytorch model (for fine-tuning or pytorch inference) is available in this repository in the `pytorch_model` folder * Config file here: `pytorch_model/config.yaml`
## Usage with `quickmt`
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
Next, install the `quickmt` python library and download the model:
```bashgit clone https://github.com/quickmt/quickmt.gitpip install -e ./quickmt/```
Finally use the model in python:
```pythonfrom quickmt import Translator
# Auto-detects GPU, set to "cpu" to force CPU inferencemt = Translator("quickmt/quickmt-uk-en", device="auto")
# Translate - set beam size to 1 for faster speed (but lower quality)sample_text = 'Д-р Ехуд Ур, професор медицини в Університеті Делхаузі у Галіфаксі, Нова Шотландія, і голова клінічного та наукового відділу Канадської Асоціації Діабету, попередив, що дослідження лише починаються.'
mt(sample_text, beam_size=5)```
> 'Dr. Ehud Ur, a professor of medicine at Delhouse University in Halifax, Nova Scotia, and head of the clinical and scientific division of the Canadian Diabetes Association, warned that the research is just beginning.'
```python# Get alternative translations by sampling# You can pass any cTranslate2 `translate_batch` argumentsmt([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)```
> 'Dr Ehud Uhr, an associate professor of medicine at Delhousy University in Halifax, Nova Scotia and the head of the clinical and scientific department of the Canadian Diabetes Association, has warned that the research has just started.'
The model is in `ctranslate2` format, and the tokenizers are `sentencepiece`, so you can use `ctranslate2` directly instead of through `quickmt`. It is also possible to get this model to work with e.g. [LibreTranslate](https://libretranslate.com/) which also uses `ctranslate2` and `sentencepiece`. A model in safetensors format to be used with `eole` is also provided.
## Metrics
`bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores). "Time (s)" is the time in seconds to translate the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32.
| Model | time | bleu | chrf ||------------------------------------|-------|-------|-------|| quickmt/quickmt_uk_en | 1.12 | 39.88 | 65.65 || Helsinki-NLP/opus-mt-tc-big-zle-en | 3.03 | 39.07 | 64.98 || facebook/nllb-200-distilled-1.3B | 17.25 | 33.59 | 63.50 || CohereLabs/tiny-aya-global | 23.36 | 37.60 | 63.73 || google/gemma-4-E2B-it | 47.71 | 37.22 | 63.75 |12345678910{ "add_source_bos": true, "add_source_eos": false, "bos_token": "<s>", "decoder_start_token": "<s>", "eos_token": "</s>", "layer_norm_epsilon": null, "multi_query_attention": false, "unk_token": "<unk>"}123version https://git-lfs.github.com/spec/v1oid sha256:d63c061e3a0eed8b61527ded6a9e5f8a74364983c454ee4652cc995a1eb612besize 202004997123version https://git-lfs.github.com/spec/v1oid sha256:5d59db4c8760263746c13387981f148c466b4712b0fbed7f31ef209db179c274size 799828424123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051model: d_model: 768 enc_layers: 12 dec_layers: 2 n_heads: 16 ffn_dim: 4096 max_len: 256 vocab_size_src: 32000 vocab_size_tgt: 32000 dropout: 0.05 mlp_type: "standard" # standard or gated activation: "gelu" # gelu or silu norm_type: "layernorm" # layernorm or rmsnorm ff_bias: true tie_decoder_embeddings: false layernorm_eps: 1.0e-5
data: src_lang: "uk" tgt_lang: "en" src_dev_path: "dev.ukr" tgt_dev_path: "dev.eng" max_tokens_per_batch: 6000 src_spm_nbest_size: -1 src_spm_alpha: 0.5 tgt_spm_nbest_size: 1 tgt_spm_alpha: 1.0 corpora: - src_file: "train.cleaned.filtered.ukr" tgt_file: "train.cleaned.filtered.eng" weight: 1 start_step: 1000 - src_file: "finetranslations.ukr_Cyrl-eng_Latn.ukr_Cyrl" tgt_file: "finetranslations.ukr_Cyrl-eng_Latn.eng_Latn" weight: 1 start_step: 0 stop_step: 80000
train: experiment_name: "uken-base" lr: 2.5e-3 grad_clip: 0.5 accum_steps: 20 max_checkpoints: 10 precision: "bfloat16" warmup_steps: 5000 max_steps: 108000 eval_steps: 1000 export: k: 5123version https://git-lfs.github.com/spec/v1oid sha256:f4ae41ace20c5b2b4287ac9d402cf93f6f857901b10ae1b20f22544073ce1c85size 1014232123version https://git-lfs.github.com/spec/v1oid sha256:832da24581d0516be8980cba35eab07fb575e703da700a919aac92d9c5c31311size 804561123version https://git-lfs.github.com/spec/v1oid sha256:f4ae41ace20c5b2b4287ac9d402cf93f6f857901b10ae1b20f22544073ce1c85size 1014232123version https://git-lfs.github.com/spec/v1oid sha256:832da24581d0516be8980cba35eab07fb575e703da700a919aac92d9c5c31311size 804561README.mdAdded+105
config.jsonAdded+10
model.binAdded+3
pytorch_model/averaged_model.safetensorsAdded+3
pytorch_model/config.yamlAdded+51
pytorch_model/tokenizer_src.modelAdded+3
pytorch_model/tokenizer_src.vocabAdded
pytorch_model/tokenizer_tgt.modelAdded+3
pytorch_model/tokenizer_tgt.vocabAdded
source_vocabulary.jsonAdded
src.spm.modelAdded+3
target_vocabulary.jsonAdded
tgt.spm.modelAdded+3