Skip to content

collinarnett/gpt2-haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpt2-haskell

A hasktorch implementation of GPT2 matching Karpathy's mingpt implementation. Only inference for now.

Getting Started

  1. Install Nix
  2. Enable Flakes
  3. Download the model.safetensors from HuggingFace

Run the inference example

  1. nix develop .
  2. cabal run inference -- [absolute/path/to/model.safetensors]

You should see an output similar to the following:

Input: Hello, I'm a language model, Generated text: Just "Hello, I'm a language model, which means I have a set of features for each" 

You can edit ./examples/inference/Main.hs to change the input or number of tokens generated.

Developing

  1. nix develop .

TODO

  • Training
  • Constraints on safetensors functions
  • Test larger gpt2 models
  • Test GPU
  • Implement logging

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors