MoxhiMT 60 zh-vi
Chinese → Vietnamese Marian-style machine translation model, tuned for xianxia / web-novel text.
Intended Use
- Chinese → Vietnamese web novel / fiction translation
- Local or server inference
- Experimental release; review output for high-stakes / publication use
Model Details
- Architecture: Marian seq2seq (8 encoder + 2 decoder layers)
- Parameters: ~57M (d_model 576, ffn 2304)
- Tokenizer: SentencePiece source/target, joint ZH+VI, vocab 24k
- Suggested decoding:
num_beams=4,max_length=512
Quick Start
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_id = "DanVP/MoxhiMT-60"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
text = "他抬头看向远处的山门。"
inputs = tok(text, return_tensors="pt", truncation=True, max_length=512)
out = model.generate(**inputs, max_length=512, num_beams=4)
print(tok.decode(out[0], skip_special_tokens=True))
CTranslate2 (INT8)
A CTranslate2 INT8 build is included under ct2-int8/ for faster CPU inference.
import ctranslate2
from transformers import AutoTokenizer
tok = AutoTokenizer.from_pretrained("DanVP/MoxhiMT-60")
translator = ctranslate2.Translator("ct2-int8", device="cpu", compute_type="int8")
text = "他抬头看向远处的山门。"
src = tok.convert_ids_to_tokens(tok(text, truncation=True, max_length=512).input_ids)
results = translator.translate_batch([src], beam_size=4, max_decoding_length=512)
print(tok.decode(tok.convert_tokens_to_ids(results[0].hypotheses[0]), skip_special_tokens=True))
Notes
- Prioritizes translation quality on xianxia / cultivation terminology.
- Trained from scratch with a custom SentencePiece-BPE 24k joint ZH+VI tokenizer.
License and attribution
Copyright 2026 DanVP.
This model is released under the Apache License 2.0. Also read NOTICE.
If you redistribute this model (for example, you bundle the weights or the ct2-int8/ build in an app):
- Include a copy of LICENSE.
- Show the text of NOTICE where your product shows third-party notices (for example, the open-source licenses screen or the About screen).
Copies of LICENSE and NOTICE are also in ct2-int8/.