Downloads · 30 days
0
prplguyy/ru-en-transformer
ru-en-transformer is a translation model from prplguyy. Use it when you need text moved from one language to another. It is set up for pytorch. The card lists the license as mit.
A compact encoder–decoder Transformer trained from scratch (no pretrained weights) for Russian→English translation. Built as a learning project — the tokenizer, model, training loop, and beam-search decoding are all h…
Downloads · 30 days
0
Access
Public
Updated Aug 7, 2026
Repo size
46.5 MB
Likes
1
Public
Click a slice to open those files.
.pt46.5 MB · 97%
From the Hugging Face model README
A compact encoder–decoder Transformer trained from scratch (no pretrained weights) for Russian→English translation. Built as a learning project — the tokenizer, model, training loop, and beam-search decoding are all hand-written.
d_model=256, 8 heads, d_ff=1024,
sinusoidal positional encoding, tied input/output embeddingstokenizer.json| Decoding | BLEU | chrF |
|---|---|---|
| Greedy | 25.04 | 47.07 |
| Beam-5 | 25.91 | 47.85 |
Validation BLEU was 26.96. Note that opus-100 (subtitle-derived) contains some misaligned reference pairs, so these BLEU numbers slightly underestimate true quality.
# pip install torch tokenizers huggingface_hub
from huggingface_hub import snapshot_download
import sys
path = snapshot_download("prplguyy/ru-en-transformer")
sys.path.insert(0, path)
from translator import translate
print(translate("Привет, как у тебя дела сегодня?", method="beam"))
# -> "Hey, how are you doing today?"
The repo bundles everything needed to run inference on CPU: model.pt (weights),
tokenizer.json, and the model/decoding code (config.py, model.py, decoding.py,
translator.py).
Small from-scratch model: strong on everyday conversational sentences, but expect rough edges on rare proper names, idioms, and long or technical text. English→Russian is not supported (trained one direction only).