Downloads · 30 days
8
21% of all-time downloads
TigreGotico/mt-hitz-gl-eu-onnx
mt-hitz-gl-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-gl-eu, a MarianMT machine translation model for gl - eu produced by HiTZ, the Basque Center for Language Technology at the University of the Basque Country (UPV/EHU).
Downloads · 30 days
8
21% of all-time downloads
All-time downloads
38
Public
Repo size
748 MB
Likes
0
Public
Click a slice to open those files.
.onnx747 MB · 99%
From the Hugging Face model README
ONNX export of HiTZ/mt-hitz-gl-eu, a MarianMT machine translation model for gl -> 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-gl-eu --task text2text-generation-with-past --no-post-process mt-hitz-gl-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 (fp32 total ~720MB, int8 total ~146MB).
Bilingual Marian model, Galician -> Basque only. No target-language token or forcing is required;
tokenizer(text) + model.generate() is sufficient.
Measured on 8 held-out gl->eu sentences, beam search (num_beams=4, max_new_tokens=64),
exact-match against the original PyTorch MarianMTModel output:
Sample translations observed (gl -> eu):
| Galician | Basque (HiTZ / ONNX, identical) |
|---|---|
| Ola, como estás? | Kaixo, zer moduz zaude? |
| O tempo hoxe é moi bo. | Gaur egun eguraldia oso ona da. |
| Gustaríame reservar unha mesa para dúas persoas. | Bi lagunentzako mahai bat erreserbatu nahi nuke. |
| Onde está a estación de tren? | Non dago tren geltokia? |
| Este libro é moi interesante. | Liburu hau oso interesgarria da. |
| Os nenos xogan no parque. | Umeek parkean jolasten dute. |
| Necesito axuda co meu ordenador. | Ordenagailuarekin laguntza behar dut. |
| A reunión comezará ás dez da mañá. | Bilera goizeko hamarretan hasiko da. |
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM
tok = AutoTokenizer.from_pretrained("TigreGotico/mt-hitz-gl-eu-onnx")
# fp32 (default, root of the repo)
model = ORTModelForSeq2SeqLM.from_pretrained("TigreGotico/mt-hitz-gl-eu-onnx")
# int8 (smaller / faster, subfolder)
# model = ORTModelForSeq2SeqLM.from_pretrained("TigreGotico/mt-hitz-gl-eu-onnx", subfolder="int8")
batch = tok(["Ola, como estás?"], 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 zaude?']