-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
172 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# NanoGPT using Lux & Reactant | ||
|
||
## Requirements | ||
|
||
* Install [julia](https://julialang.org/) | ||
* In the Julia REPL instantiate the `Project.toml` in the parent directory | ||
|
||
## Training | ||
|
||
To train a model, run `main.jl` with the necessary parameters. | ||
|
||
```bash | ||
julia --startup=no --project=examples/NanoGPT --threads=auto examples/NanoGPT/main.jl | ||
``` | ||
|
||
## Inference | ||
|
||
To run inference on a trained model, run `main.jl` with the necessary parameters. | ||
|
||
```bash | ||
julia --startup=no --project=examples/NanoGPT --threads=auto examples/NanoGPT/main.jl \ | ||
--inference \ | ||
--model-path=<path to model checkpoint> | ||
``` | ||
|
||
## Usage | ||
|
||
```bash | ||
main | ||
|
||
Usage | ||
|
||
main [options] [flags] | ||
|
||
Options | ||
|
||
--n-embed <64::Int> | ||
--n-hidden <256::Int> | ||
--n-heads <4::Int> | ||
--qk-dim <16::Int> | ||
--v-dim <16::Int> | ||
--n-layers <6::Int> | ||
--sequence-length <64::Int> | ||
--batchsize <128::Int> | ||
--dropout-rate <0.0::Float32> | ||
--test-split <0.1::Float64> | ||
--lr <0.01::Float64> | ||
--epochs <100::Int> | ||
--model-path <::String> | ||
--seed <::Union{String, Vector{String}}> | ||
--output-length <1024::Int> | ||
|
||
Flags | ||
|
||
--inference | ||
-h, --help Print this help message. | ||
--version Print version. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters