TigreGotico/arat5-arabic-dialects-translation-onnx
AraT5 Arabic dialects -> MSA translation - ONNX
ONNX export of `PRAli22/arat5-arabic-dialects-translation`, an AraT5-based model translating Arabic dialects (Gulf, Egyptian, Levantine, Maghrebi, etc.) into Modern Standard Arabic (MSA).
Licence: apache-2.0, as declared by the source repository.
Provenance note: this is a single-author community model (6 downloads, 3 likes on the source repo at the time of conversion), not an institutional release. It was spot-checked before conversion effort was invested: it loads correctly and produces sensible, non-degenerate MSA output for Gulf/Egyptian/Levantine/Maghrebi test sentences (see parity section) - it is not a broken or abandoned checkpoint, but treat its quality claims with the caution due any single-author model without institutional validation.
Contents
fp32 size: ~2.8 GB | int8 size: ~1.9 GB
Usage
from optimum.onnxruntime import ORTModelForSeq2SeqLM
from transformers import AutoTokenizer
repo = "TigreGotico/arat5-arabic-dialects-translation-onnx"
tok = AutoTokenizer.from_pretrained(repo)
model = ORTModelForSeq2SeqLM.from_pretrained(repo, use_cache=True, use_merged=False) # fp32
# int8: ORTModelForSeq2SeqLM.from_pretrained(repo, subfolder="int8", use_cache=True, use_merged=False)
inputs = tok("شلونك اليوم؟ شخبارك؟", return_tensors="pt")
out = model.generate(**inputs, num_beams=4, max_new_tokens=64)
print(tok.decode(out[0], skip_special_tokens=True))
# -> كيف حالك اليوم؟ كيف حالك؟Parity with the original PyTorch model
5 Arabic dialect sentences (Gulf, Egyptian, Levantine, Maghrebi), exact-string-match of generated output against AutoModelForSeq2SeqLM.generate() on the original checkpoint.
parity:
sample_size: 5
metric: exact_match
fp32_greedy: 1.00 # 5/5
fp32_beam4: 1.00 # 5/5
int8_greedy: 0.40 # 2/5
int8_beam4: 0.60 # 3/5fp32 is an exact reproduction of the original model. int8 shows real quality variance on this small (5-sentence) sample - larger than most other conversions in this org's inventory - but disagreements were inspected by hand and are paraphrase-level (e.g. ref "بصحة جيدة" vs int8 "بحالة جيدة", both meaning "in good health/condition"), not garbled or wrong-language output. In one case the int8 output ("كيف حالك اليوم؟", "how are you today?") is arguably a more faithful translation than the reference's own output ("كيف حال الطقس اليوم؟", "how is the weather today?") for a source sentence that does not mention weather - a reminder that "parity" here means matching the original checkpoint, not independently verified correctness.
Caveat on sample size: n=5 is a very small smoke-test - the int8 percentages above should be read as an initial signal only, not a stable quality figure. Prefer fp32 for this model until a larger evaluation is available.
