-
Notifications
You must be signed in to change notification settings - Fork 2
/
finetune.sh
60 lines (54 loc) · 2.34 KB
/
finetune.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
56
57
58
#!/bin/bash
# normal cpu stuff: allocate cpus, memory
#SBATCH --job-name=finetune-pixelsmall
#SBATCH --ntasks=1 --cpus-per-task=48 --mem=70000M
#SBATCH -p gpu --gres=gpu:a100:1
#SBATCH --time=20:00:00
export ENCODER="Team-PIXEL/pixel-base"
export DECODER="gpt2"
export DATASET="xsum"
export EXPERIMENT_DIR="experiments/finetune/$DECODER/"`date +%Y-%m-%d_%H-%M-%S`
mkdir -p ${EXPERIMENT_DIR}
python3 -m scripts.training.run_finetuning \
--model_path "/home/vpz558/PixelSum/experiments/pretrained_gptsmall" \
--encoder_name ${ENCODER} \
--decoder_name ${DECODER} \
--processor_name ${ENCODER} \
--tokenizer_name ${DECODER} \
--fallback_fonts_dir "fonts" \
--dataset_name ${DATASET} \
--dataloader_num_workers 32 \
--do_train true \
--do_eval false \
--do_predict true \
--train_decoder false \
--train_encoder false \
--evaluation_strategy "steps" \
--eval_steps 1000 \
--predict_with_generate true \
--logging_strategy "steps" \
--logging_steps 50 \
--save_strategy "steps" \
--save_steps 1000 \
--fp16 true \
--fp16_full_eval true \
--output_dir ${EXPERIMENT_DIR} \
--overwrite_output_dir false \
--log_predictions true \
--per_device_train_batch_size 64 \
--gradient_accumulation_steps 1 \
--learning_rate 1.5e-4 \
--weight_decay 0.05 \
--warmup_ratio 0.05 \
--lr_scheduler_type "cosine" \
--warmup_steps 1000 \
--max_steps 15000 \
--val_max_target_length 50 \
--max_target_length 50 \
--load_best_model_at_end true \
--use_fast_tokenizer true \
--num_beams 1 \
--report_to "wandb" \
--max_eval_samples 100 \
--max_predict_samples 1500 \
--data_cache_dir 'cached_data' \