Downloads · 30 days
8
22% of all-time downloads
TigreGotico/mt-hitz-en-eu-onnx
mt-hitz-en-eu-onnx is a translation model from TigreGotico. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
ONNX export of HiTZ/mt-hitz-en-eu, a MarianMT machine translation model for en - eu produced by HiTZ, the Basque Center for Language Technology at the University of the Basque Country (UPV/EHU).
Downloads · 30 days
8
22% of all-time downloads
All-time downloads
37
Public
Repo size
440 MB
Likes
0
Public
Click a slice to open those files.
.onnx439 MB · 100%
From the Hugging Face model README
ONNX export of HiTZ/mt-hitz-en-eu, a MarianMT machine translation model for en -> eu produced by HiTZ, the Basque Center for Language Technology at the University of the Basque Country (UPV/EHU).
All credit for training and releasing the original model goes to the HiTZ team. This repo
only contains an ONNX conversion (fp32 and int8) for fast CPU inference with
optimum[onnxruntime], done by TigreGotico.
apache-2.0, as declared on the source model card.
optimum-cli export onnx --model HiTZ/mt-hitz-en-eu --task text2text-generation-with-past --no-post-process mt-hitz-en-eu-onnx
int8 dynamic quantization was applied afterwards with optimum.onnxruntime.ORTQuantizer
(AVX2 config, dynamic) into the int8/ subfolder.
encoder_model.onnx # fp32
decoder_model.onnx # fp32
decoder_with_past_model.onnx # fp32
config.json, generation_config.json
source.spm, target.spm, vocab.json, tokenizer_config.json, special_tokens_map.json
int8/
encoder_model.onnx
decoder_model.onnx
decoder_with_past_model.onnx
No external-data files were produced — this Marian model is small enough that all graphs stay under the 2GB single-file protobuf limit.
Bilingual Marian model, English -> Basque only. No target-language token or forcing is required;
tokenizer(text) + model.generate() is sufficient.
Measured on 8 held-out en->eu sentences, beam search (num_beams=4, max_new_tokens=64),
exact-match against the original PyTorch MarianMTModel output:
Sample translations observed (en -> eu):
| English | Basque (HiTZ / ONNX, identical) |
|---|---|
| Hello, how are you? | Kaixo, zer moduz? |
| The weather today is very good. | Gaurko eguraldia oso ona da. |
| I would like to book a table for two people. | Mahai bat bi pertsonentzat erreserbatu nahi dut. |
| Where is the train station? | Non dago tren geltokia? |
| This book is very interesting. | Liburu hau oso interesgarria da. |
| The children play in the park. | Umeek parkean jolasten dute. |
| I need help with my computer. | Laguntza behar dut nire ordenagailuarekin. |
| The meeting will start at ten in the morning. | Bilera goizeko hamarretan hasiko da. |
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM
tok = AutoTokenizer.from_pretrained("TigreGotico/mt-hitz-en-eu-onnx")
model = ORTModelForSeq2SeqLM.from_pretrained("TigreGotico/mt-hitz-en-eu-onnx")
# int8: ORTModelForSeq2SeqLM.from_pretrained("TigreGotico/mt-hitz-en-eu-onnx", subfolder="int8")
batch = tok(["Hello, how are you?"], return_tensors="pt")
generated = model.generate(**batch, num_beams=4, max_new_tokens=64)
print(tok.batch_decode(generated, skip_special_tokens=True))
# ['Kaixo, zer moduz?']