-
Notifications
You must be signed in to change notification settings - Fork 59
/
finetune_lora.sh
35 lines (33 loc) · 1021 Bytes
/
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
CACHE_DIR="./cache" # revised to your cache directory
DATA_PATH="datasets/gpt4tools_71k.json" # datasets
DEEPSPEED_CONFIG="scripts/zero2.json"
OUTPUT_DIR="outputs/vicuna-13b-v1.5-gpt4tools"
MODEL="lmsys/vicuna-13b-v1.5"
deepspeed train.py \
--model_name_or_path $MODEL \
--deepspeed $DEEPSPEED_CONFIG \
--lora_r 16 \
--lora_alpha 16 \
--lora_dropout 0.05 \
--data_path $DATA_PATH \
--bf16 True \
--tf32 True \
--output_dir $OUTPUT_DIR \
--num_train_epochs 3 \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 1 \
--gradient_accumulation_steps 16 \
--evaluation_strategy "no" \
--save_strategy "steps" \
--save_steps 1200 \
--save_total_limit 10 \
--learning_rate 2e-5 \
--weight_decay 0. \
--warmup_ratio 0.03 \
--lr_scheduler_type "cosine" \
--logging_steps 1 \
--model_max_length 2048 \
--lazy_preprocess True \
--cache_dir $CACHE_DIR \
--report_to 'tensorboard' \
--gradient_checkpointing True