Downloads · 30 days
12
24% of all-time downloads
TigreGotico/liv4ever-mt-onnx
liv4ever-mt-onnx is a translation model from TigreGotico. Use it when you need text moved from one language to another. It is set up for optimum. The card lists the license as apache-2.0.
ONNX export of tartuNLP/liv4ever-mt, a multilingual translation model covering English, Estonian, Latvian and Livonian. Livonian is a Finnic language with fewer than 20 native speakers.
Downloads · 30 days
12
24% of all-time downloads
All-time downloads
50
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.onnx1.3 GB · 99%
From the Hugging Face model README
ONNX export of tartuNLP/liv4ever-mt,
a multilingual translation model covering English, Estonian, Latvian and
Livonian. Livonian is a Finnic language with fewer than 20 native speakers.
The original is a fairseq checkpoint, which optimum-cli cannot read.
Checked against fairseq-interactive at beam 4 on 15 English → Livonian sentences.
| build | exact match vs fairseq |
|---|---|
| fp32 | 15/15 |
| int8 | 12/15 |
int8 is included for convenience; use fp32 if output must track the original.
fairseq .pt → MarianMTModel → optimum-cli export onnx.
This checkpoint is a stock fairseq transformer with
encoder_normalize_before=False, so it is post-norm with no
layernorm_embedding — which is exactly HF Marian. Marian even inherits
fairseq's parameter names, so the layer weights transfer unrenamed.
Two details are load-bearing:
exp(-log(10000)·i/(dim/2−1)); Marian
rebuilds the table with 10000^(2i/dim). HF drops position weights on save,
so fairseq's table has to be force-persisted or roughly half the translations
change.from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM
repo = "TigreGotico/liv4ever-mt-onnx"
model = ORTModelForSeq2SeqLM.from_pretrained(repo) # subfolder="int8" for int8
tok = AutoTokenizer.from_pretrained(repo)
text = "<2li> The children are playing in the garden."
out = model.generate(**tok(text, return_tensors="pt"), num_beams=4, max_length=256)
print(tok.decode(out[0], skip_special_tokens=True))
# Lapst mǟngabõd tarās.
Prepend the target language tag to the source sentence. There is no source tag — the model infers the source language.
| tag | target |
|---|---|
<2en> | English |
<2et> | Estonian |
<2lv> | Latvian |
<2li> | Livonian |
The tags are registered as special tokens, so pass them as plain text in the sentence; the tokenizer keeps them intact.
A standard MarianTokenizer (SentencePiece, separate source/target vocab files).
No manual preprocessing is needed.
encoder_model.onnx, decoder_model.onnx, decoder_with_past_model.onnx — fp32int8/ — dynamically quantized (MatMul only, output projection excluded)source.spm, target.spm, vocab.json, target_vocab.jsonApache-2.0, unchanged from the original. The model was built by TartuNLP, University of Tartu, as part of the Livonian 4 Ever work on Livonian language resources. All credit belongs to them; this repository only changes the serialization format.