chi-vi/hirashiba-mt-zh2vi-b-filtered
Viewer β’ Updated β’ 24.1M β’ 77 β’ 1
How to use ngocdang83/HachimiMT-30-zh-vi with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("translation", model="ngocdang83/HachimiMT-30-zh-vi") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("ngocdang83/HachimiMT-30-zh-vi")
model = AutoModelForSeq2SeqLM.from_pretrained("ngocdang83/HachimiMT-30-zh-vi")# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("ngocdang83/HachimiMT-30-zh-vi")
model = AutoModelForSeq2SeqLM.from_pretrained("ngocdang83/HachimiMT-30-zh-vi")Fast Chinese to Vietnamese Marian-style machine translation model.
num_beams=1, max_length=512FLORES-200 zho_Hans -> vie_Latn devtest, decoded with num_beams=1,
max_length=512.
| Evaluation set | Rows | BLEU | chrF | Chinese-character leak rows |
|---|---|---|---|---|
| FLORES-200 devtest | 1,012 | 14.29 | 37.30 | 0 |
This is a general-domain benchmark; it is useful for public comparability but does not fully reflect web-novel style or domain terminology.
Metric notes:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_id = "ngocdang83/HachimiMT-30-zh-vi"
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=1)
print(tok.decode(out[0], skip_special_tokens=True))
ct2-int8_float32/ for faster CPU inference.
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="ngocdang83/HachimiMT-30-zh-vi")