forked from jackfsuia/bert-chunker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.sh
55 lines (53 loc) · 1.57 KB
/
train.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
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
export CUDA_DEVICE_MAX_CONNECTIONS=1
# ATTENTION: specify the path to your training data, which should be a json file consisting of a list of conversations.
# See the section for finetuning in README for more information.
DEBUGPY=False
function usage(){
echo 'Usage: bash finetune/finetune_ds.sh [-m MODEL_PATH] [-d DATA_PATH]'
}
while [[ "$1" != "" ]]; do
case $1 in
-b | --debug )
shift
DEBUGPY=True
;;
-h | --help )
usage
exit 0
;;
* )
echo "Unknown argument ${1}"
exit 1
;;
esac
shift
done
# echo "The value of my_variable is: $GPUS_PER_NODE and $NNODES"
# torchrun $DISTRIBUTED_ARGS finetune_new.py \
python train_chunk_model.py \
--base_model_name_or_path "nreimers/MiniLM-L6-H384-uncased" \
--data_path "mixed_passenge_train_30000.json" \
--eval_data_path "mixed_passenge_eval_30000.json" \
--output_dir "outputModels" \
--num_train_epochs 3 \
--per_device_train_batch_size 8 \
--per_device_eval_batch_size 235 \
--gradient_accumulation_steps 1 \
--evaluation_strategy "epoch" \
--evaluate_before_train False \
--save_strategy "epoch" \
--save_steps 50 \
--save_total_limit 20 \
--learning_rate 3e-4 \
--weight_decay 0.1 \
--adam_beta2 0.95 \
--warmup_ratio 0.01 \
--lr_scheduler_type "cosine" \
--log_level 'info'\
--logging_dir "outputModels/logs" \
--logging_strategy "epoch" \
--report_to "tensorboard" \
--model_max_length 255 \
--lazy_preprocess True \
--gradient_checkpointing False \