ATF β†’ English (T5-small), ONNX for Transformers.js

Current version: v4e (2026-10-11). ONNX export of montycrypto/atf-to-english (checkpoint atf-en-best-v4e) for in-browser use with Transformers.js v3. Used by the Unread Atlas in-browser translator. The previous (v2) export is preserved at tag v2-2026-10-07.

file precision size
onnx/encoder_model_quantized.onnx + onnx/decoder_model_merged_quantized.onnx int8 (dynamic, default dtype: "q8") β‰ˆ 94 MB
onnx/encoder_model.onnx + onnx/decoder_model_merged.onnx fp32 (dtype: "fp32") β‰ˆ 374 MB

Export: optimum-cli export onnx --task text2text-generation-with-past, then onnxruntime dynamic int8 quantization (EnableSubgraph for the merged decoder).

Tokenizer note. tokenizer.json here differs from the PyTorch repo: the Sequence[WhitespaceSplit, Metaspace] pre-tokenizer is replaced by a single classic T5 Metaspace (add_prefix_space: true), because Transformers.js 3.7 mis-tokenizes the original. Token ids from Transformers.js with this file match Python transformers on the ATF inputs tested. For Python, keep using the original repo.

import { pipeline } from "@huggingface/transformers";
const t = await pipeline("text2text-generation", "montycrypto/atf-to-english-onnx", { dtype: "q8" });
const out = await t("translate Akkadian to English: a-na LUGAL be-li2-ia ARAD-ka",
                    { max_new_tokens: 100, repetition_penalty: 1.2 });
// β†’ "To the king, my lord: your servant."

Decoding note. Transformers.js 3.x has no beam search: num_beams is ignored and decoding is greedy. repetition_penalty: 1.2 is recommended (also set in generation_config.json). The source model's reference decoding (Python) is 4 beams + repetition_penalty 1.2 + a custom loop-block processor that is not available in Transformers.js, so browser output can differ in wording and can occasionally loop on long, badly formatted lines.

Parity check (v4e). On 5 sample lines, Python onnxruntime int8 and fp32 outputs were identical to PyTorch (greedy and 4-beam); Transformers.js 3.7.5 token ids matched Python on all 5, its fp32 output matched PyTorch greedy on all 5, and its int8 output matched on 4 of 5 (one line worded differently).

Source model, training data, evaluation and known misreads: montycrypto/atf-to-english.

Prompt prefix translate Akkadian to English: , one line per call. Output is a machine draft, not a scholarly translation.

Downloads last month
32
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for montycrypto/atf-to-english-onnx

Quantized
(1)
this model