Downloads · 30 days
4
4% of all-time downloads
myduy/dlm-vi2en-checkpoint-138000
dlm-vi2en-checkpoint-138000 is a text generation model from myduy. Use it when you need the model to write or continue text.
This is a Vietnamese to English translation model based on the DLM architecture.
Downloads · 30 days
4
4% of all-time downloads
All-time downloads
101
Public
Parameters
579M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
This is a Vietnamese to English translation model based on the DLM architecture.
Base model is: "FacebookAI/xlm-roberta-large"
Please ensure you have the following library versions installed:
pip install torch>=2.9.1 transformers>=4.57.3
Below is the Python code to run the model. It automatically utilizes the GPU if available and loads the model from the local cache after the first run.
import torch
from transformers import AutoTokenizer, AutoModel
# 1. Configuration
repo_id = "myduy/dlm-vi2en-checkpoint-138000"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# 2. Load Model & Tokenizer
# trust_remote_code=True is required for custom architectures
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).to(device)
model.eval()
# 3. Prepare Input
text = "cậu có muốn đến nghe không?"
inputs = tokenizer(text, return_tensors="pt").to(device)
# 4. Generate
with torch.no_grad():
output_tokens = model.generate(
inputs.input_ids,
max_iterations=50,
temperature=1.0,
strategy="reparam-uncond-deterministic-cosine"
)
# 5. Decode Output
output_text = tokenizer.batch_decode(output_tokens, skip_special_tokens=True)[0]
print(f"Input: {text}")
print(f"Output: {output_text}")