How cognizaunce/gpt works
Project type and purpose
• This is a machine-learning training and inference pipeline for generating Shakespeare-style poems using a GPT model. It is not a traditional web or mobile app, but a data-driven research/experimentation codebase with scripts and notebooks for preprocessing, training, checkpoint management, and inference.
File structure
• Top-level scripts and notebooks
• CharacterDataset.py – builds a character-level dataset from raw text
• PoemGeneration.py & PoemGeneration.ipynb – inference drivers that load a trained model and generate poems
• ShakespeareGPT.py – likely an alternate inference or orchestration script
• data/ directory
• input.txt, linalg.txt – raw text sources for training
• checkpoints/ directory
• transformers.pt – serialized model weights
• gpt/ package
• gpt.py, gpt1.py – core model definitions (GPT architecture and variants)
• sublayers.py – attention, feed-forward, layer-norm implementations
• trainer.py – training loop, optimizer, batching, logging
• utils/gpt_config.py – hyperparameters and model configuration
• utils/utils.py – auxiliary functions (tokenization, sampling)
README for additional insights
• README only states: “ShakespeareGPT. Makes poems that sound like shakespeare.”
Detail without over-complicating
• Every top-level script/notebook as a consumer or producer of data/model
• How gpt/utils and gpt/sublayers feed into gpt/gpt and gpt/trainer
• Do not omit the checkpoints folder—model persistence is a critical component