Instructions to use Douglasrambo/opus-mt-tc-big-en-pt-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Douglasrambo/opus-mt-tc-big-en-pt-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('translation', 'Douglasrambo/opus-mt-tc-big-en-pt-onnx');
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:
tokenizer.jsonvocabulary re-indexed to matchvocab.jsonids (the generated one followedsource.spmorder, producing wrong ids), and>>xxx<<added as special tokens.decoder_model_mergedre-merged withoptimum.onnx.merge_decoders(the one produced during export gave degraded output).Rangeinputs 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
Model tree for Douglasrambo/opus-mt-tc-big-en-pt-onnx
Base model
Helsinki-NLP/opus-mt-tc-big-en-pt