opus-mt-tc-big-en-pt (ONNX, transformers.js)

ONNX conversion of Helsinki-NLP/opus-mt-tc-big-en-pt (Tiedemann & Thottingal, OPUS-MT, University of Helsinki — CC-BY-4.0) for use with transformers.js.

  • onnx/*_quantized.onnx: int8 (q8), for WASM/CPU.
  • onnx/*_q4.onnx: 4-bit MatMul (q4), for WebGPU (no shader-f16 needed).

Prefix every input with >>pob<< (Brazilian Portuguese) or >>por<<, and translate one sentence per call: the original model drops sentences after the first when given several at once.

Conversion fixes vs. a plain scripts/convert.py run:

  1. tokenizer.json vocabulary re-indexed to match vocab.json ids (the generated one followed source.spm order, producing wrong ids), and >>xxx<< added as special tokens.
  2. decoder_model_merged re-merged with optimum.onnx.merge_decoders (the one produced during export gave degraded output).
  3. Range inputs in the merged decoder reshaped to scalars (onnxruntime's Range+Gather→Slice fusion failed with "Starts must be a 1-D array").

Validated against the PyTorch reference output on real Project Gutenberg paragraphs.

Downloads last month
43
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Douglasrambo/opus-mt-tc-big-en-pt-onnx

Quantized
(2)
this model