- Implementing Transformer from Scratch with PyTorch as a Python Package
- Notebook playground for all transformer's block-by-block
- Launching training process, saving trained model for each epoch
- Testing inference process with latest trained model
- Navigate into the project directory:
cd project
- Create Python conda environment:
conda create -n ENV_NAME python=3.11
- Activate ENV_NAME environment:
conda activate ENV_NAME
- Install the required dependencies:
pip install -r requirements.txt
- Using jupyterlab:
jupyter lab
- Or, playing notebooks directly with VScode IDE
- It is recommended to train the transformer with GPU if possible. If GPU is available in your machine, installing appropriate Torch and Cuda for your system to activate GPU's usage. Follow the instructions in the 'requirements.txt' file.
- Launch the training process with the following command in the terminal:
python train.py
- Play with the notebook file:
nb_inference.ipynb
This project is a key part of my course on Udemy: Hands-on Generative AI Engineering with Large Language Models