Instructions to use gshbao/MT-explain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use gshbao/MT-explain with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("../../.models/LexMatcher_8B") model = PeftModel.from_pretrained(base_model, "gshbao/MT-explain") - Notebooks
- Google Colab
- Kaggle
MT-explain: LoRA Adapter for Terminology-Aware Machine Translation
A specialized LoRA adapter that generates a terminology list (术è¯è¡¨) before producing the final translation for high-accuracy, consistent machine translation.
Model Details
- Model Type: LoRA Adapter for LLMs
- Base Model: LexMatcher_8B
- Current Language Support: German → English (De-En)
- Planned Support: Chinese → English (Zh-En)
- Core Function: Terminology glossary generation + final translation
- Inference Engine: Optimized for vLLM with LoRA enabled
Model Description
MT-explain is a fine-tuned LoRA adapter built on top of LexMatcher_8B. It follows a unique two-step generation process:
- First, generate a terminology list for the input source text
- Then, generate the final translation using the terminology for consistency
This ensures domain-specific terms, proper nouns, and technical vocabulary are translated accurately and consistently.
Deployment & Inference Guide
1. Prepare Local Files
Download both the base model and adapter to your local machine:
- Base model path:
./LexMatcher_8B - LoRA adapter path:
./MT-explain
2. Install Dependencies
pip install vllm>=0.4.0 transformers peft torch
3. Start vLLM Server (with LoRA)
Run this exact command:
vllm serve ./LexMatcher_8B \
--host 0.0.0.0 \
--port 8000 \
--dtype auto \
--enable-lora \
--lora-modules my-lora=./MT-explain \
--gpu-memory-utilization 0.90 \
--max-model-len 1024
4. Test Inference
The model will automatically output:Terminology List → Final Translation
Limitations
- Only supports De-En translation (Zh-En coming soon)
- Optimized for max sequence length: 1024 tokens
- Requires vLLM for LoRA inference
- Terminology accuracy may vary for highly niche domains
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for gshbao/MT-explain
Base model
Lemoooon/LexMatcher_8B