Views
No views yet
projecte-aina/aina-translator-es-an,
Projecte Aina's (Barcelona Supercomputing Center, Language Technologies Unit) Spanish → Aragonese
machine translation model. All credit for training data, fine-tuning and evaluation goes to
Projecte Aina — see the
source model card for training
details, BLEU/ChrF numbers, and paper reference.onnxruntime (CPU, no PyTorch/CUDA dependency) via optimum.cc-by-nc-4.0, verbatim as declared on the source model card
(projecte-aina/aina-translator-es-an). Same licence applies to this derived ONNX export.encoder_model.onnx(_data) fp32 encoder
decoder_model.onnx(_data) fp32 decoder (no cache)
decoder_with_past_model.onnx(_data) fp32 decoder (with KV cache)
int8/encoder_model.onnx dynamic-quantized (uint8) encoder
int8/decoder_model.onnx dynamic-quantized (uint8) decoder
int8/decoder_with_past_model.onnx dynamic-quantized (uint8) decoder w/ cache
sentencepiece.bpe.model, tokenizer.json, tokenizer_config.json, ... tokenizer files (NLLB-style SentencePiece)*.onnx_data next to each *.onnx graph file). int8 files are small enough to be single-file.M2M100ForConditionalGeneration (transformers model_type: m2m_100), fine-tuned
by Projecte Aina from facebook/nllb-200-distilled-600M.1optimum-cli export onnx \
2 --model projecte-aina/aina-translator-es-an \
3 --task text2text-generation-with-past \
4 --no-post-process \
5 aina-translator-es-an-onnx--no-post-process is required: optimum's decoder-merge step OOMs on this model size on
constrained hardware. As a result the ONNX export ships an un-merged decoder_model.onnx
(no cache) and decoder_with_past_model.onnx (with cache) instead of a single
decoder_model_merged.onnx.optimum.onnxruntime.ORTQuantizer, AVX2 config) was applied to each of
the three graphs.arg_Latn, and set tokenizer_config.json to
src_lang: spa_Latn, tgt_lang: arg_Latn. There is no forced_bos_token_id in
generation_config.json — the tokenizer's baked-in tgt_lang plus the model's
decoder_start_token_id (2) are sufficient; a plain tokenizer(text) + model.generate() call
already yields Aragonese output. Do not pass forced_bos_token_id explicitly; arg_Latn is a
model-specific token repurposed for this fine-tune, per the source model card.num_beams=4, max_new_tokens=64, compared against the original
PyTorch model (transformers.AutoModelForSeq2SeqLM) with identical decoding settings.| exact-match rate | |
|---|---|
| ONNX fp32 | 8/8 = 100.0% |
| ONNX int8 (dynamic) | not separately re-verified against reference; same graphs, expect near-parity |
| Spanish | Aragonese (Aina / ONNX, identical) |
|---|---|
| Hola, ¿cómo estás? | Ola, cómo yes? |
| El tiempo hoy es muy bueno. | Lo tiempo hue ye muit bueno. |
| Me gustaría reservar una mesa para dos personas. | Me faría goyo reservar una mesa pa dos personas. |
| ¿Dónde está la estación de tren? | An ye la estación de tren? |
| Este libro es muy interesante. | Iste libro ye muit interesant. |
| Los niños juegan en el parque. | Los ninos chugan en o parque. |
| Necesito ayuda con mi ordenador. | Amenisto aduya con lo mío ordinador. |
| La reunión comenzará a las diez de la mañana. | La reunión prencipiará a las diez d'o maitín. |
1from transformers import AutoTokenizer
2from optimum.onnxruntime import ORTModelForSeq2SeqLM
3
4model_id = "TigreGotico/aina-translator-es-an-onnx"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = ORTModelForSeq2SeqLM.from_pretrained(model_id) # fp32
8# int8: ORTModelForSeq2SeqLM.from_pretrained(model_id, subfolder="int8")
9
10text = "Hola, ¿cómo estás?"
11ids = tokenizer(text, return_tensors="pt").input_ids
12out = model.generate(ids, num_beams=4, max_new_tokens=64)
13print(tokenizer.decode(out[0], skip_special_tokens=True))
14# Ola, cómo yes?langtech@bsc.es.