Downloads · 30 days
48
24% of all-time downloads
olob0/madlad400-3b-mt-ct2-int8_float16
madlad400-3b-mt-ct2-int8_float16 is a translation model from olob0. Use it when you need text moved from one language to another. It is set up for ctranslate2. The card lists the license as apache-2.0.
google/madlad400-3b-mt converted to the CTranslate2 format and quantised to int8float16. The same model, 2.8 GB instead of 11.8 GB, and it loads without a conversion step.
Downloads · 30 days
48
24% of all-time downloads
All-time downloads
199
Public
Repo size
3 GB
Likes
0
Public
Click a slice to open those files.
.bin2.9 GB · 99%
From the Hugging Face model README
google/madlad400-3b-mt converted to the CTranslate2 format and quantised to int8_float16. The same model, 2.8 GB instead of 11.8 GB, and it loads without a conversion step.
The tokenizer files are included, so nothing else has to be downloaded.
import ctranslate2
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
path = snapshot_download("olob0/madlad400-3b-mt-ct2-int8_float16")
tokenizer = AutoTokenizer.from_pretrained(path)
translator = ctranslate2.Translator(path, device="cuda", compute_type="int8_float16")
tokens = tokenizer.convert_ids_to_tokens(tokenizer("<2en> Bom dia.").input_ids)
result = translator.translate_batch([tokens])
print(tokenizer.decode(tokenizer.convert_tokens_to_ids(result[0].hypotheses[0])))
MADLAD takes the target language as a <2xx> token at the front of the source text. Put it in the
string and let the tokenizer handle it. Prepending the bare token to the token list instead loses
the word boundary piece in front of it, and the translation comes back mangled with no error.
ct2-transformers-converter --model google/madlad400-3b-mt \
--quantization int8_float16 --output_dir madlad400-3b-mt-ct2-int8_float16 \
--copy_files tokenizer.json tokenizer_config.json special_tokens_map.json spiece.model added_tokens.json
Apache-2.0, inherited from the original model. Original work by Google, this is a format conversion of it.