Skip to content

Commit

Permalink
Add exp_id and resume for continual pretrain
Browse files Browse the repository at this point in the history
  • Loading branch information
research4pan committed Oct 30, 2023
1 parent 0eab352 commit cc04e42
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions scripts/run_continual_pretrain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ num_train_epochs=0.01
per_device_train_batch_size=1
save_steps=1000
deepspeed_args="--master_port=11000"
learning_rate=2e-5
resume_from_checkpoint=None
exp_id=continual-pretrain

while [[ $# -ge 1 ]]; do
key="$1"
Expand Down Expand Up @@ -44,29 +47,42 @@ while [[ $# -ge 1 ]]; do
save_steps=$2
shift
;;
-r|--resume_from_checkpoint)
resume_from_checkpoint=$2
shift
;;
--lr|--learning_rate)
learning_rate=$2
shift
;;
--deepspeed_args)
deepspeed_args="$2"
shift
;;
--exp_id)
exp_id=$2
shift
;;
*)
echo "error: unknown option \"${key}\"" 1>&2
exit 1
esac
shift
done

exp_id=continual-pretrain
project_dir=$(cd "$(dirname $0)"/..; pwd)
log_dir=${project_dir}/log/${exp_id}
mkdir -p ${output_dir} ${log_dir}

# --evaluation_strategy steps \
deepspeed ${deepspeed_args} \
examples/finetune.py \
--model_name_or_path ${model_name_or_path} \
--resume_from_checkpoint ${resume_from_checkpoint} \
--dataset_path ${dataset_path} \
--output_dir ${output_dir} --overwrite_output_dir \
--num_train_epochs ${num_train_epochs} \
--learning_rate 2e-5 \
--learning_rate ${learning_rate} \
--block_size 2048 \
--per_device_train_batch_size ${per_device_train_batch_size} \
--per_device_eval_batch_size 1 \
Expand All @@ -77,8 +93,7 @@ deepspeed ${deepspeed_args} \
--validation_split_percentage 0 \
--logging_steps 1 \
--do_train \
--do_eval \
--evaluation_strategy steps \
--evaluation_strategy no \
--eval_steps ${save_steps} \
--eval_dataset_path ${eval_dataset_path} \
--ddp_timeout 72000 \
Expand Down

0 comments on commit cc04e42

Please sign in to comment.