A hasktorch implementation of GPT2 matching Karpathy's mingpt implementation. Only inference for now.
- Install Nix
- Enable Flakes
- Download the
model.safetensorsfrom HuggingFace
nix develop .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.
nix develop .
- Training
- Constraints on safetensors functions
- Test larger gpt2 models
- Test GPU
- Implement logging