Skip to content

🤖 Building a transformer from scratch — because if suffering builds character, it might as well build a seq2seq translation model too!

Notifications You must be signed in to change notification settings

aandyw/TransformerFromScratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TransformerFromScratch

🤖

Setup

Setup the local development environment using

./scripts/setup_env.sh     # Create virtual env & download dependencies
source .venv/bin/activate  # Activate it

Exercise

  • notebooks/transformer_from_scratch_exercise.ipynb contains a practice notebook to build a transformer from scratch by filling in missing portions of the code. It's a good way to review your knowledge of Transformers.

  • The solution is in notebooks/transformer_from_scratch_solution.ipynb.

Training

Training for the GPU poor T_T

  1. Upload the notebooks/train_model.ipynb notebook into colab (or kaggle) and run on GPU

If you're GPU self-sufficient you can run locally:

  1. Login to huggingface with huggingface-cli login
  2. Run python transformer/train.py

Acknowledgements

A variety of resources that really helped us out in understanding and implementing the Transformer model

About

🤖 Building a transformer from scratch — because if suffering builds character, it might as well build a seq2seq translation model too!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published