michaelfeil/ct2fast-opus-mt-es-en
1147
# Fast-Inference with Ctranslate2
Speedup inference by 2x-8x using int8 inference in C++
quantized version of Helsinki-NLP/opus-mt-es-en
pip install hf-hub-ctranslate2>=1.0.0 ctranslate2>=3.13.0Converted using
ct2-transformers-converter --model Helsinki-NLP/opus-mt-es-en --output_dir /home/michael/tmp-ct2fast-opus-mt-es-en --force --copy_files README.md generation_config.json tokenizer_config.json vocab.json source.spm .gitattributes target.spm --quantization float16Checkpoint compatible to ctranslate2 and hf-hub-ctranslate2
compute_type=int8_float16fordevice="cuda"compute_type=int8fordevice="cpu"
from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
from transformers import AutoTokenizer
model_name = "michaelfeil/ct2fast-opus-mt-es-en"
# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
model = TranslatorCT2fromHfHub(
# load in int8 on CUDA
model_name_or_path=model_name,
device="cuda",
compute_type="int8_float16",
tokenizer=AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-es-en")
)
outputs = model.generate(
text=["How do you call a fast Flan-ingo?", "User: How are you doing?"],
)
print(outputs)Licence and other remarks:
This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.
Original description
spa-eng
- source group: Spanish
- target group: English
- OPUS readme: spa-eng
- model: transformer
- source language(s): spa
- target language(s): eng
- model: transformer
- pre-processing: normalization + SentencePiece (spm32k,spm32k)
- download original weights: opus-2020-08-18.zip
- test set translations: opus-2020-08-18.test.txt
- test set scores: opus-2020-08-18.eval.txt
Benchmarks
System Info:
- hf_name: spa-eng
- source_languages: spa
- target_languages: eng
- opusreadmeurl: https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/spa-eng/README.md
- original_repo: Tatoeba-Challenge
- tags:
- ctranslate2 ['translation']
- languages: ['es', 'en']
- src_constituents: {'spa'}
- tgt_constituents: {'eng'}
- src_multilingual: False
- tgt_multilingual: False
- prepro: normalization + SentencePiece (spm32k,spm32k)
- url_model: https://object.pouta.csc.fi/Tatoeba-MT-models/spa-eng/opus-2020-08-18.zip
- urltestset: https://object.pouta.csc.fi/Tatoeba-MT-models/spa-eng/opus-2020-08-18.test.txt
- src_alpha3: spa
- tgt_alpha3: eng
- short_pair: es-en
- chrF2_score: 0.7390000000000001
- bleu: 59.6
- brevity_penalty: 0.9740000000000001
- ref_len: 79376.0
- src_name: Spanish
- tgt_name: English
- train_date: 2020-08-18 00:00:00
- src_alpha2: es
- tgt_alpha2: en
- prefer_old: False
- long_pair: spa-eng
- helsinkigitsha: d2f0910c89026c34a44e331e785dec1e0faa7b82
- transformersgitsha: f7af09b4524b784d67ae8526f0e2fcc6f5ed0de9
- port_machine: brutasse
- port_time: 2020-08-24-18:20
