Downloads · 30 days
34
41% of all-time downloads
xezpeleta/mt-hitz-en-eu-ct2
mt-hitz-en-eu-ct2 is a translation model from xezpeleta. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
Downloads · 30 days
34
41% of all-time downloads
All-time downloads
83
Public
Repo size
97 MB
Likes
0
Public
Click a slice to open those files.
.bin97 MB · 99%
From the Hugging Face model README
CTranslate2 is a C++ and Python library for efficient inference with Transformer models.
CTranslate2 implements a custom runtime that applies many performance optimization techniques such as weights quantization, layers fusion, batch reordering, etc., to accelerate and reduce the memory usage of Transformer models on CPU and GPU.
CTranslate2 is one of the most performant ways of hosting translation models at scale. Current supported models include:
The project is production-oriented and comes with backward compatibility guarantees, but it also includes experimental features related to model compression and inference acceleration.
pip install hf-hub-ctranslate2>=1.0.0 ctranslate2>=3.13.0
ct2-transformers-converter --model HiTZ/mt-hitz-en-eu --output_dir ./ctranslate2/mt-hitz-en-eu-ct2 --force --copy_files README.md generation_config.json tokenizer_config.json vocab.json source.spm .gitattributes target.spm --quantization float16
Compatible With:
Compute Type:
compute_type=int8_float16 for device="cuda"compute_type=int8 for device="cpu"git clone https://huggingface.co/xezpeleta/mt-hitz-en-eu-ct2
from ctranslate2 import Translator
import transformers
model_dir = "./mt-hitz-en-eu-ct2" # Path to model directory.
translator = Translator(
model_path=model_dir,
device="cuda", # cpu, cuda, or auto.
inter_threads=1, # Maximum number of parallel translations.
intra_threads=4, # Number of OpenMP threads per translator.
compute_type="int8_float16", # int8 for cpu or int8_float16 for cuda.
)
tokenizer = transformers.AutoTokenizer.from_pretrained(model_dir)
source = tokenizer.convert_ids_to_tokens(tokenizer.encode("Hello, world!"))
results = translator.translate_batch([source])
target = results[0].hypotheses[0]
print(tokenizer.decode(tokenizer.convert_tokens_to_ids(target)))
This work is licensed under a Apache License, Version 2.0