quickmt models are roughly 3 times faster for GPU inference than OpusMT models and roughly
40 times faster than
LibreTranslate/
ArgosTranslate.
If you want to do GPU inference be sure you have the Nvidia driver and cuda toolkit installed.
1git clone https://github.com/quickmt/quickmt.git
2pip install -e ./quickmt/
1from quickmt import Translator
2
3# Auto-detects GPU, set to "cpu" to force CPU inference
4mt = Translator("quickmt/quickmt-is-en", device="auto")
5
6# Translate - set beam size to 1 for faster speed (but lower quality)
7sample_text = 'Dr. Ehud Ur, læknaprófessor við Dalhousie-háskólann í Halifax í Nova Scotia og formaður klínískrar vísindadeildar Kanadíska sykursýkissambandsins, minnti á að rannsóknin væri rétt nýhafin.'
8
9mt(sample_text, beam_size=5)
1# Get alternative translations by sampling
2# You can pass any cTranslate2 `translate_batch` arguments
3mt([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
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 which also uses
ctranslate2 and
sentencepiece. A model in safetensors format to be used with
eole is also provided.
bleu and
chrf2 are calculated with
sacrebleu on the
Flores200 devtest test set and
Bouquet test set. "Time (s)" is the time in seconds to translate dataset on an RTX 4070s GPU with batch size 32. LLM inference done with vLLM and 32 threads.
Benchmarks are hard to get right and make fair. Download this model and give it a try and see if it works well for you!