Practical overview
When it fits
Use it when you want to explore or train a small neural machine translation model in code, or need a modular baseline to adapt to paired-text data.
Who it is for
- Developers and learners studying a compact, readable PyTorch translation model.
- Practitioners seeking a modular encoder-decoder starting point for sequence-to-sequence work.
Documented uses
- Train a German-to-English model on the Multi30k dataset.
- Inspect a batched GRU encoder-decoder implementation with attention.
- Adapt the model and data pipeline for another paired-text translation corpus.
Requirements & limits
- The documented workflow needs Python 3.9+, PyTorch 2.0+, Hugging Face Datasets and spaCy 3.7+.
- The README describes automatic device selection across CUDA, Apple MPS and CPU.
- Changing the language pair can require dataset preprocessing, tokenization, vocabulary and spaCy model adjustments.
- The repository specifies an MIT license.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up and train the Multi30k translation model
Install the documented dependencies and start training the German-to-English model.
Before you start
- Python 3.9 or later
- PyTorch 2.0 or later, with CPU, CUDA or Apple MPS support
- Hugging Face Datasets and spaCy 3.7 or later
Steps
Install the dependencies with the command below.
pip install -r requirements.txtDownload the German and English spaCy models with the command below and the command below.
python -m spacy download de_core_news_smpython -m spacy download en_core_web_smStart training with the command below.
python train.py -epochs 30 -batch_size 32 -lr 3e-4
Expected outcome
The documented training workflow starts a German-to-English model run using Multi30k data.
Guide limitations
- For CPU smoke runs, the README suggests smaller
-hidden_sizeand-embed_sizevalues. - The documented dataset and language models are German-to-English; other language pairs may require changes to preprocessing, tokenization, vocabulary and spaCy models.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 7 November 2026
- Original website title
- keon/seq2seq · Official homepage title · retained in its source language

