This repository contains the implementation of a text generation project using various machine learning models (LSTM, Transformer Decoder, xLSTM) for next-word prediction. Follow the instructions below to set up your environment, install dependencies, and run the project.
Create a Python virtual environment to manage project dependencies. You can use venv
or conda
for this purpose. Here is an example using venv
:
python -m venv text-gen-env
Activate the virtual environment:
- On Windows:
text-gen-env\Scripts\activate
- On macOS and Linux:
source text-gen-env/bin/activate
Install the required dependencies from the requirements.txt
file:
pip install -r requirements.txt
If you want to keep track of the training status, you can use Weights & Biases (W&B). Follow these steps:
- Create a W&B account: Weights & Biases Quickstart
- Create a new project named
text-generation
. - Log in to your W&B account from the command line:
wandb login
You can change the parameters for the models and training process in the config.yaml
file. This file contains various settings that control the behavior of the training scripts.
Finally, run the run.sh
bash script to start the training process:
bash run.sh
Once the training phase is completed, to evaluate the predictions qualitatively, we include the Jupyter notebook text_generation.ipynb
where the trained models generate next-word predictions for given input sequences. You can use this notebook to analyze the qualitative results.
This README.md
provides clear and concise instructions for setting up and running the text generation project, making it easy for users to get started and track their training progress.