Skip to content

Commit db5d7ab

Browse files
author
Aniket
committed
Adding more information in the README to use conversion tool.
1 parent a3fa0ab commit db5d7ab

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
## Convert llama2.c model to ggml
22

3-
This example reads weights from project [llama2.c](https://github.com/karpathy/llama2.c) and saves them in ggml compatible format.
3+
This example reads weights from project [llama2.c](https://github.com/karpathy/llama2.c) and saves them in ggml compatible format. The vocab that is available in `models/ggml-vocab.bin` is used by default.
44

55
To convert the model first download the models from the [llma2.c](https://github.com/karpathy/llama2.c) repository:
66

77
`$ make -j`
88

9-
`$ ./convert-llama2c-to-ggml --vocab-model <ggml-vocab.bin> --llama2c-model <llama2.c model path> --llama2c-output-model <ggml output model path>`
9+
After successful compilation, following usage options are available:
10+
```
11+
usage: ./convert-llama2c-to-ggml [options]
1012
11-
Now you can use the model with command:
13+
options:
14+
-h, --help show this help message and exit
15+
--copy-vocab-from-model FNAME model path from which to copy vocab (default 'models/ggml-vocab.bin')
16+
--llama2c-model FNAME [REQUIRED] model path from which to load Karpathy's llama2.c model
17+
--llama2c-output-model FNAME model path to save the converted llama2.c model (default ak_llama_model.bin')
18+
```
19+
20+
An example command is as follows:
21+
22+
`$ ./convert-llama2c-to-ggml --copy-vocab-from-model <ggml-vocab.bin> --llama2c-model <llama2.c model path> --llama2c-output-model <ggml output model path>`
23+
24+
Now you can use the model with command like:
1225

1326
`$ ./main -m <ggml output model path> -p "One day, Lily met a Shoggoth" -n 500 -c 256 -eps 1e-5`

0 commit comments

Comments
 (0)