iandennismiller
commited on
Commit
•
10e91e5
1
Parent(s):
6a8d17c
include training script but do not install
Browse files- bin/from-scratch-training.sh +55 -0
bin/from-scratch-training.sh
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
MODEL_NAME=shakespeare
|
4 |
+
TRAIN_DATA=$HOME/scratch/shakespeare.txt
|
5 |
+
VOCAB=$HOME/.ai/models/ggml-vocab.bin
|
6 |
+
|
7 |
+
LLAMA_CTX=256
|
8 |
+
LLAMA_EMBD=256
|
9 |
+
LLAMA_HEAD=32
|
10 |
+
LLAMA_LAYER=24
|
11 |
+
LLAMA_BATCH=16
|
12 |
+
|
13 |
+
MODEL_OUT=$HOME/.ai/models/llama/ggml-${MODEL_NAME}-${LLAMA_CTX}-${LLAMA_EMBD}x${LLAMA_HEAD}x${LLAMA_LAYER}-f32.bin
|
14 |
+
CHECKPOINT=$HOME/.ai/training/chk-${MODEL_NAME}-${LLAMA_CTX}-${LLAMA_EMBD}x${LLAMA_HEAD}x${LLAMA_LAYER}.bin
|
15 |
+
|
16 |
+
function train() {
|
17 |
+
time ~/Work/llama.cpp/build/bin/train-text-from-scratch \
|
18 |
+
--train-data "$TRAIN_DATA" \
|
19 |
+
--model-out "$MODEL_OUT" \
|
20 |
+
--checkpoint-in "$CHECKPOINT" \
|
21 |
+
--checkpoint-out "$CHECKPOINT" \
|
22 |
+
--vocab-model "$VOCAB" \
|
23 |
+
--ctx $LLAMA_CTX \
|
24 |
+
--embd $LLAMA_EMBD \
|
25 |
+
--head $LLAMA_HEAD \
|
26 |
+
--layer $LLAMA_LAYER \
|
27 |
+
--batch $LLAMA_BATCH \
|
28 |
+
--examples 128 \
|
29 |
+
--rotmax 128 \
|
30 |
+
--seed 1 \
|
31 |
+
--adam-iter 16 \
|
32 |
+
--print-details-interval 0 \
|
33 |
+
--predict 16 \
|
34 |
+
--use-flash \
|
35 |
+
--threads 6
|
36 |
+
}
|
37 |
+
|
38 |
+
function print_params() {
|
39 |
+
echo "TRAIN_DATA: $TRAIN_DATA"
|
40 |
+
echo "CTX: $LLAMA_CTX"
|
41 |
+
echo "EMBD: $LLAMA_EMBD"
|
42 |
+
echo "HEAD: $LLAMA_HEAD"
|
43 |
+
echo "LAYER: $LLAMA_LAYER"
|
44 |
+
echo "BATCH: $LLAMA_BATCH"
|
45 |
+
echo
|
46 |
+
echo "$HOME/Work/llama.cpp/build/bin/main --temp 0.05 --top_k 70 --top_p 0.79 -m $MODEL_OUT --repeat-penalty 1.3"
|
47 |
+
}
|
48 |
+
|
49 |
+
function main() {
|
50 |
+
print_params
|
51 |
+
train
|
52 |
+
print_params
|
53 |
+
}
|
54 |
+
|
55 |
+
main
|