-
Notifications
You must be signed in to change notification settings - Fork 14
/
finetune-lora.sh
42 lines (42 loc) · 1.34 KB
/
finetune-lora.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
output_model=output
if [ ! -d ${output_model} ];then
mkdir ${output_model}
fi
deepspeed --include localhost:1,2 --master_port 29000 finetune-lora.py \
--model_name_or_path ./models/daryl149/llama-2-7b-chat-hf \
--tokenizer_name ./merged_tokenizer_hf \
--train_files ./data/alpaca_gpt4_data_zh.json \
--validation_files ./data/trans_chinese_alpaca_data.json \
--per_device_train_batch_size 4 \
--per_device_eval_batch_size 4 \
--do_train \
--do_eval \
--use_fast_tokenizer true \
--output_dir ${output_model} \
--evaluation_strategy steps \
--max_eval_samples 800 \
--learning_rate 1e-4 \
--gradient_accumulation_steps 8 \
--num_train_epochs 5 \
--warmup_steps 400 \
--load_in_bits 8 \
--lora_r 8 \
--lora_alpha 16 \
--target_modules q_proj,k_proj,v_proj,o_proj,down_proj,gate_proj,up_proj \
--logging_dir ${output_model}/logs \
--logging_strategy steps \
--logging_steps 10 \
--save_strategy steps \
--preprocessing_num_workers 10 \
--save_steps 200 \
--eval_steps 200 \
--save_total_limit 2000 \
--seed 42 \
--disable_tqdm false \
--ddp_find_unused_parameters false \
--block_size 1024 \
--report_to tensorboard \
--overwrite_output_dir \
--ignore_data_skip true \
--gradient_checkpointing \
--ddp_timeout 18000000