Hy-MT3-1.8B-StreamRevise-LoRA
a live subtitle translation adapter
2 min readupdated
This model is a LoRA adapter (a small add-on to a base model) for tencent/Hy-MT3-1.8B, fine-tuned for live subtitle translation tasks while accounting for changing automatic speech recognition (ASR) hypotheses. At each speech recognition update step, the model receives the current text, the previous translation version, and a status ("in progress" or "end of phrase"), which allows it to maintain a stable prefix, correct past errors, and insert punctuation on time. The solution is useful for developers of simultaneous translation systems, voice assistants, and live streams.
Key features
- Specialization: trained on live translation tasks with support for ASR error correction and prefix preservation.
- Directions: focus on language pairs involving Chinese, English, and Japanese.
- Efficiency: attention-oriented LoRA with 13.6M trainable parameters (~0.75%).
- Compatibility: full integration with the Hugging Face
peftecosystem and the transformers library.
What you can do
- Live subtitles: integrate into stream or video conference pipelines to output translations on the fly.
- Voice bot: use in combination with ASR models for real-time speech dubbing and translation.
- Batch translation: apply in standard one-shot mode for translating entire sentences.
Example
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE = "tencent/Hy-MT3-1.8B"
ADAPTER = "febilly/Hy-MT3-1.8B-StreamRevise-LoRA"
tokenizer = AutoTokenizer.from_pretrained(BASE, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
BASE, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
)
model = PeftModel.from_pretrained(model, ADAPTER).eval()
Read more
DetailsMetrics: FLORES-200 devtest chrF 46.194 (combined corpus).
Training: 2 epochs, batch size 32, AdamW optimizer, bf16 precision.
Limitations: stability depends on strict adherence to the prompt format and the use of greedy decoding (
do_sample=False).Base:
tencent/Hy-MT3-1.8B (1.8B parameters, 32 layers).









Comments