Downloads · 30 days
1
3% of all-time downloads
TigreGotico/opus-mt-pt-ca-onnx
opus-mt-pt-ca-onnx is a translation model from TigreGotico. Use it when you need text moved from one language to another. It is set up for transformers.js. The card lists the license as apache-2.0.
ONNX export of Helsinki-NLP/opus-mt-pt-ca, a MarianMT model for direct Portuguese → Catalan translation.
Downloads · 30 days
1
3% of all-time downloads
All-time downloads
32
Public
Repo size
601 MB
Likes
0
Public
Click a slice to open those files.
.onnx600 MB · 100%
From the Hugging Face model README
ONNX export of Helsinki-NLP/opus-mt-pt-ca, a MarianMT model for direct Portuguese → Catalan translation.
Licence: apache-2.0 (verbatim from the upstream model card).
Attribution: model trained and published by Helsinki-NLP / University of Helsinki as part of the
OPUS-MT project (Tatoeba-Challenge, por-cat,
opus-2020-06-17). This repository only republishes an ONNX conversion of their weights; no model changes
were made.
This model is a single-pair model (Portuguese → Catalan only). No >>xxx<< target token is required or
supported.
encoder_model.onnx, decoder_model.onnx, decoder_with_past_model.onnx (fp32, repo root)
source.spm, target.spm, vocab.json, tokenizer_config.json, special_tokens_map.json, config.json, generation_config.json
int8/
encoder_model.onnx, decoder_model.onnx, decoder_with_past_model.onnx (dynamic QUInt8 quantization)
(+ copies of the tokenizer files)
optimum-cli export onnx --model Helsinki-NLP/opus-mt-pt-ca \
--task text2text-generation-with-past --no-post-process ./fp32
int8: onnxruntime.quantization.quantize_dynamic(weight_type=QUInt8) applied to each of the three graphs
independently, written to int8/.
8 Portuguese sentences, PyTorch (MarianMTModel) vs ONNX (ORTModelForSeq2SeqLM), num_beams=4,
max_new_tokens=64, exact string match after decoding:
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM
tok = AutoTokenizer.from_pretrained("TigreGotico/opus-mt-pt-ca-onnx")
model = ORTModelForSeq2SeqLM.from_pretrained("TigreGotico/opus-mt-pt-ca-onnx")
text = "O tempo está bom hoje."
ids = model.generate(**tok(text, return_tensors="pt"), num_beams=4, max_new_tokens=64)
print(tok.decode(ids[0], skip_special_tokens=True))
# El temps està bé avui.
For int8, pass subfolder="int8" instead.