Skip to content

A pure Haskell implementation of a decoder-only transformer (GPT)

Notifications You must be signed in to change notification settings

tensor-fusion/GPT-Haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haskell GPT

Super minimal implementation of GPT-2 in Haskell.

Highly inspired by:

Structure is similar to picoGPT. Code contains:

  • Translation of OpenAI's BPE Tokenizer
  • Decoder-only transformer
  • GPT-2 generation

You can run tests with

cabal build
cabal test

(You'll first need to download GPT-2 weights, tokenizer, and hyperparams into /models)

TODO

  • Merge changes containing top-k sampling and tensorflow inference for actual text generation
  • Nix deps management

About

A pure Haskell implementation of a decoder-only transformer (GPT)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published