This project contains a small LLM (Large Language Model) that can be trained and used for text generation.
Before running anything, install dependencies:
pip install torch sentencepiece tqdmCreate a file named wiki.txt and add the your content (text) to it. Before training the model, you must prepare the tokenizer:
python tokenizer.pyThis step ensures that the tokenizer is trained and ready to be used.
To train the model, run:
python main.py --DEVICE cuda --mode trainIf you want to train on CPU, run:
python main.py --DEVICE cpu --mode trainOnce trained, you can generate text:
python main.py --DEVICE cuda --mode inferenceIf you trained the model on CPU, you can also infer on CPU:
python main.py --DEVICE cpu --mode inferenceFor more information, visit: Ideami