Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/endlessreform/nanogpt-candle
Exercise: implementing Karpathy's nanoGPT in Candle
https://github.com/endlessreform/nanogpt-candle
Last synced: about 6 hours ago
JSON representation
Exercise: implementing Karpathy's nanoGPT in Candle
- Host: GitHub
- URL: https://github.com/endlessreform/nanogpt-candle
- Owner: EndlessReform
- License: mit
- Created: 2024-02-09T02:14:34.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-12T05:00:53.000Z (8 months ago)
- Last Synced: 2024-03-13T05:38:09.626Z (8 months ago)
- Language: Rust
- Homepage:
- Size: 355 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## NanoGPT, in Candle, spelled out
This repo is an implementation of [nanoGPT](https://github.com/karpathy/nanoGPT) in [Candle](https://github.com/huggingface/candle), a Rust-based PyTorch alternative.
If you use this in production, well, that's on you buddy.
## Installation
Install Rust if you haven't already done so. Then in root:
```bash
cargo build
# If on Nvidia platform
cargo build --features cuda
# If on Apple Silicon
cargo build --features metal
```Add TinyShakespeare dataset:
```bash
mkdir corpus
curl 'https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt' -o corpus/shakespeare.txt
```## Usage
Train TinyShakespeare tokenizer:
```bash
cargo run --bin train_tokenizer -- -i corpus/shakespeare.txt -o models
```