GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - VitaCodez/miniGPT: A small LM. decoder only

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
data
data
 
 
models
models
 
 
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

miniGPT

A compact, educational implementation of a Generative Pre-trained Transformer (GPT) model built from scratch in PyTorch. This project serves as a learning experiment to understand the inner workings of Transformer architectures, self-attention mechanisms, and Large Language Model (LLM) training pipelines.

Project Overview

This repository contains:

  • Core Transformer Architecture: Implementation of Self-Attention, Decoder Blocks, and the full Transformer model.
  • Training Pipeline: Scripts to train the model on provided text datasets using mixed precision (autocast).
  • Inference: A testing script to generate text based on user prompts.
  • Data Processing: Utilities to clean and prepare raw text data (e.g., books) for training.

Note: This is a learning project. The model was trained on a single NVIDIA RTX 2070 Super, which limited the model size and training duration.

Results & Limitations

  • Current Model Version: model7_geminiVersion
  • Training Hardware: RTX 2070 Super
  • Performance:
    • The model successfully learned to generate coherent sentences and structures.
    • However, due to limited VRAM and training time, it struggles with long-term coherence and maintaining context over extended passages.
    • It is recommended to retrain on a larger dataset and more powerful hardware for better results.

Books Used for Training

The following books were used to create the dataset:

  • 1984
  • Animal Farm
  • Eragon (Series)
  • Harry Potter (Series)
  • Lord of the Rings (Series)

Directory Structure

  • src/: Source code for the model, training, and data processing.
  • data/: Dataset used for training (excluded from repo due to size).
  • models/: Saved model checkpoints (excluded from repo due to size).

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/miniGPT.git
    cd miniGPT
  2. Install dependencies:

    pip install torch tokenizers

Usage

1. Prepare Dataset

If you have raw text files in data/booksOfDataset, run:

cd src
python makedataset.py

This will generate finalDataset2.txt in the data/ directory.

2. Train the Model

To start training:

cd src
python train.py

This will save checkpoints and the final model to the models/ directory.

3. Generate Text

To test the model:

cd src
python testing.py

Future Work

  • Implement more efficient attention mechanisms (e.g., Flash Attention).
  • Scale up the model parameters.
  • Train on a more diverse dataset (e.g., OpenWebText or C4).

About

A small LM. decoder only

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.