Views
No views yet
train.txt. Separate each entry with <|endoftext|>. Here is some example code:1import json
2
3with open("WizardLM_alpaca_evol_instruct_70k_unfiltered.json", "r") as fh:
4 data = json.load(fh)
5 for item in data:
6 if len(item.get("instruction")) > 0 and len(item.get("output")) > 0:
7 print(item["instruction"])
8 print("\n### Response:", end="")
9 print(item["output"])
10 print("<|endoftext|>")python prepare_data.pytrain.npy. Keep track of the number of tokens.1apt install screen ncdu htop vim
2wget https://huggingface.co/BlinkDL/rwkv-4-pile-14b/resolve/main/RWKV-4-Pile-14B-20230313-ctx8192-test1050.pth
3# replace import for inf from torch._six with import from math
4vim /usr/local/lib/python3.10/dist-packages/deepspeed/runtime/utils.py
5vim /usr/local/lib/python3.10/dist-packages/deepspeed/runtime/zero/stage_1_and_2.py
6pip install pytorch-lightning==1.9.0 deepspeed==0.7.0
7pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.0 --extra-index-url https://download.pytorch.org/whl/cu118
8apt install cuda-nvcc-11-8 libcusparse-11-8 libcusparse-dev-11-8 libcublas-dev-11-8 libcublas-11-8 libcusolver-dev-11-8 libcusolver-11-8
9apt remove cuda-nvcc-11-6n_layer and n_embd is dependent on the specifc model you choose.lora_alpha must be the same in training and the merge_lora.py command.epoch_count is calculated from tokens / (ctx_len * micro_bsz * epoch_steps) * actual_epochs1python3 train.py \
2 --load_model ./RWKV-4-Pile-3B-20221110-ctx4096.pth \
3 --proj_dir ./checkpoints-wizardlm \
4 --data_file ./train.npy \
5 --data_type numpy \
6 --vocab_size 50277 \
7 --ctx_len 1024 \
8 --epoch_steps 1000 \
9 --epoch_count 34 \
10 --epoch_begin 0 \
11 --epoch_save 5 \
12 --micro_bsz 2 \
13 --n_layer 40 \
14 --n_embd 5120 \
15 --pre_ffn 0 \
16 --head_qk 0 \
17 --lr_init 1e-4 \
18 --lr_final 5e-7 \
19 --warmup_steps 0 \
20 --beta1 0.9 \
21 --beta2 0.999 \
22 --adam_eps 1e-8 \
23 --lora \
24 --lora_r 32 \
25 --lora_alpha 64 \
26 --lora_dropout 0.05 \
27 --lora_parts=att,ffn,time,ln \
28 --accelerator gpu \
29 --devices 1 \
30 --precision bf16 \
31 --grad_cp 0 \
32 --strategy deepspeed_stage_2python merge_lora.py 64 RWKV-4-Pile-14B-20230313-ctx8192-test1050.pth rwkv-45.pth RWKV-14B-WizardLM.pth