pure_transformer is just a repo about transformer, derived from SamLynnEvans/Transformer and The Annotated Transformer
- reconstructe the project structure
- update code with new pytorch api
first, you would like to train your model, as follow
python train.py -src_data pathto/lang1.txt -trg_data pathto/lang2.txt -src_lang lang1 -trg_lang lang2
after train model, you can get a vocab and a model in folder weights/.
we set deafult args in code. download this repo, and just click you run button. Then take a meal, whatever
torchtext.data and torchtext.legacy will be complete removed. In this issue link, you can find a migration tutorial.
if you want to customize your data input, you can follow the tutorial, or you can like me, debug code, find what kind of data we put in model.
Variables are no longer necessary to use autograd with tensors.
Autograd automatically supports Tensors with requires_grad set to True
here's my naive solution, substiting Variable() with torch.tensor()