Translation
Transformers.js
ONNX
Chinese
Vietnamese
marian
text2text-generation
quantized
chinese
vietnamese
web
Instructions to use DanVP/MoxhiMT-30-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use DanVP/MoxhiMT-30-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('translation', 'DanVP/MoxhiMT-30-onnx');
MoxhiMT-30 zh→vi — ONNX cho trình duyệt (transformers.js)
Bản ONNX của DanVP/MoxhiMT-30 (MarianMT ~37M tham số, 8 encoder / 2 decoder, dịch tiếng Trung → tiếng Việt cho truyện mạng/tiên hiệp), đóng gói để chạy trực tiếp trong trình duyệt bằng 🤗 Transformers.js.
🖥️ Demo: DanVP/moxhimt — dịch hoàn toàn trên thiết bị, chọn model trong phần Nâng cao.
Model chị em: DanVP/HachimiMT-30-zh-vi-onnx (6 encoder, ~31M — nhẹ và nhanh hơn một chút). Hai model dùng vocab khác nhau, không dùng lẫn tokenizer được.
File
| File | Kích thước | Ghi chú |
|---|---|---|
onnx/encoder_model_quantized.onnx |
~31 MB | int8 động (QUInt8, per-channel) — mặc định cho WASM |
onnx/decoder_model_merged_quantized.onnx |
~29 MB | int8 động, quantize cả subgraph của node If |
onnx/encoder_model_fp16.onnx / decoder_model_merged_fp16.onnx |
~61 / 57 MB | cho WebGPU |
onnx/encoder_model.onnx / decoder_model_merged.onnx |
~121 / 113 MB | fp32 gốc |
Tokenizer
source.spm là SentencePiece BPE (byte_fallback=true) — tokenizer.json được dựng bằng
tokenizers.models.BPE với merges trích từ spm, đã kiểm tra encode/decode khớp 100% với
MarianTokenizer gốc.
Dùng với Transformers.js
import { pipeline } from '@huggingface/transformers';
const translator = await pipeline('translation', 'DanVP/MoxhiMT-30-onnx', { dtype: 'q8' });
const out = await translator('他抬起头,看见月光下的剑冢。', { max_new_tokens: 128 });
// → "Hắn ngẩng đầu lên, nhìn thấy Kiếm Trủng dưới ánh trăng."
Ghi công
- Trọng số gốc: DanVP/MoxhiMT-30
- Export bằng 🤗 Optimum (
text2text-generation-with-past), quantize bằng ONNX Runtime (quantize_dynamic,EnableSubgraph=True).
- Downloads last month
- 10
Model tree for DanVP/MoxhiMT-30-onnx
Base model
DanVP/MoxhiMT-30