Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniGPT — Lightweight Transformer & Web Application

A lightweight, fully customizable GPT (Decoder-only Transformer) model built from scratch in PyTorch. This project covers the entire end-to-end LLM lifecycle: training a custom BPE tokenizer, training the model, serving inference via a FastAPI backend, and running an interactive Gradio web UI.


🏗️ Architecture & Features

  • Custom GPT Architecture: Decoder-only Transformer with scaled dot-product Multi-Head Self-Attention, LayerNorm, GELU activations, and positional embeddings.
  • Custom Tokenizer: Hugging Face tokenizers Byte-Pair Encoding (BPE) trained specifically on the target dataset.
  • REST API: Production-ready FastAPI server (app.py) for serving text generation endpoints.
  • Interactive Web UI: Gradio interface (frontend.py) featuring customizable generation parameters (temperature, max tokens).

📁 Repository Structure

myGPT/
├── src/
│   ├── model.py        # PyTorch MiniGPT architecture definition
│   ├── train.py        # Tokenizer training & model training loop
│   └── generate.py     # Standalone CLI generation script
├── tokenizer/          # Saved custom tokenizer files (tokenizer.json)
├── app.py              # FastAPI backend API
├── frontend.py         # Gradio web user interface
├── requirements.txt    # Python dependencies
└── README.md

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages