GitHub - nathan-barry/gpt2-webgl: A browser-based, WebGL2 implementation of GPT-2 with transform block and attention matrix visualization
GPT-2 WebGL Inference Demo
A browser-based, WebGL2 implementation of GPT-2.
🚀 Features
Full GPT-2 small (117M) forward pass in the GPU via WebGL2 shaders
BPE tokenization using js-tiktoken in the browser (no WASM fetch)
Simple Python script to download the pretrained weights
📋 Prerequisites
Node.js ≥ 16.x and npm
Python ≥ 3.8
A modern browser with WebGL2 support (Chrome, Firefox, Safari, Edge)
🐍 Download the GPT-2 Weights
We rely on HuggingFace’s transformers to pull down the official GPT-2 w...
Read more at github.com