aoiandroid/opus
By aoiandroid · ↓ 0 · ♥ 0 · Updated 2026-02-14
What's in this repo
This page lists the files in aoiandroid/opus, including decoder_model.onnx, decoder_model_merged.onnx, decoder_with_past_model.onnx and more.
- 2636 ONNX models (.onnx files)
- 8563 files, including 3949 .json, 2636 .onnx, 1316 .spm, 660 .md, 1 .yaml
- Last updated 2026-02-14
ONNX files
| File | Size | Download |
|---|---|---|
| Helsinki-NLP-opus-mt-NORTH_EU-NORTH_EU/decoder_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-NORTH_EU-NORTH_EU/decoder_model_merged.onnx | — | Download |
| Helsinki-NLP-opus-mt-NORTH_EU-NORTH_EU/decoder_with_past_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-NORTH_EU-NORTH_EU/encoder_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-ROMANCE-en/decoder_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-ROMANCE-en/decoder_model_merged.onnx | — | Download |
| Helsinki-NLP-opus-mt-ROMANCE-en/decoder_with_past_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-ROMANCE-en/encoder_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-SCANDINAVIA-SCANDINAVIA/decoder_model.onnx | — | Download |
| Helsinki-NLP-opus-mt-SCANDINAVIA-SCANDINAVIA/decoder_model_merged.onnx | — | Download |
Showing 10 of 2636 .onnx files — see the full file list on the right.
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
OPUS-MT ONNX Model Hub
Mirror of VaishalBusiness/opus (VGT ONNX Model Hub): 1,000+ OPUS-MT translation models in ONNX format for fast inference.
Highlights
- 1,000+ ONNX models from Helsinki-NLP / MarianMT
- Optimized for inference with ONNX Runtime
- Compatible with Hugging Face tokenizers
- Same layout and usage as the original VGT hub
Repository structure
Each model is in its own folder, for example:
Helsinki-NLP-opus-mt-tc-base-bat-zle/
├── config.json
├── decoder_model.onnx
├── decoder_model_merged.onnx
├── decoder_with_past_model.onnx
├── encoder_model.onnx
├── generation_config.json
├── source.spm
├── target.spm
├── special_tokens_map.json
├── tokenizer_config.json
└── vocab.json
- encoder_model.onnx – encoder
- decoder_with_past_model.onnx – decoder with KV cache
- decoder_model_merged.onnx – merged decoder (recommended for speed)
- decoder_model.onnx – base decoder
- source.spm / target.spm, vocab.json – tokenizer files
Usage
Dependencies
pip install huggingface_hub onnxruntime transformers sentencepiece
Load and run a model
Replace Helsinki-NLP-opus-mt-tc-base-bat-zle with any model folder name from the repo.
from huggingface_hub import snapshot_download
import onnxruntime as ort
from transformers import MarianTokenizer
import numpy as np
# Download the model folder (use this repo id after renaming to opus-mt-onnx)
repo_id = "aoiandroid/opus-mt-onnx" # or aoiandroid/opus if not renamed yet
model_dir = snapshot_download(
repo_id=repo_id,
allow_patterns="Helsinki-NLP-opus-mt-tc-base-bat-zle/*",
)
# Load tokenizer
tokenizer = MarianTokenizer.from_pretrained(
f"{model_dir}/Helsinki-NLP-opus-mt-tc-base-bat-zle"
)
# Encode input
inputs = tokenizer("Hello, how are you?", return_tensors="np")
# Run encoder
enc = ort.InferenceSession(
f"{model_dir}/Helsinki-NLP-opus-mt-tc-base-bat-zle/encoder_model.onnx"
)
enc_out = enc.run(
None,
{
"input_ids": inputs["input_ids"],
"attention_mask": inputs["attention_mask"],
},
)
# Run merged decoder
dec = ort.InferenceSession(
f"{model_dir}/Helsinki-NLP-opus-mt-tc-base-bat-zle/decoder_model_merged.onnx"
)
decoder_input_ids = np.array([[tokenizer.pad_token_id]], dtype=np.int64)
out = dec.run(
None,
{
"input_ids": decoder_input_ids,
"encoder_hidden_states": enc_out[0],
},
)
Attribution
- Original ONNX hub: VaishalBusiness/opus (VGT ONNX Model Hub)
- Underlying models: Helsinki-NLP OPUS-MT / MarianMT
- ONNX conversions and hosting follow the original project’s intent; licenses of each model are unchanged.
License
Each model keeps its original license. When using a model, cite the original authors and comply with their license and attribution requirements. This repository only provides a mirror of ONNX conversions.
Model info
Created: 2026-02-13
Updated: 2026-02-14
View on Hugging Face