Skip to content

Commit 6632253

Browse files
committed
Config files for running models
1 parent 9dd8d22 commit 6632253

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

python/configs/codeT5.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
data:
2+
batch_size: 1
3+
eval_batch_size: 1
4+
5+
model:
6+
pretrained_model: Salesforce/codet5-base
7+
pretrained_tokenizer: Salesforce/codet5-base
8+
skip_special_token_when_generate: False
9+
beam_size: 20
10+
11+
trainer:
12+
auto_select_gpus: true
13+
gpus: -1
14+
strategy: ddp
15+
# find_unused_parameters: false
16+
precision: 16
17+
18+
# max_steps: 50_000
19+
# fast_dev_run: true
20+
max_epochs: 30
21+
accumulate_grad_batches: 4 # effective batch size 1*4(gpu)*4(accumulate) = 32
22+
23+
callbacks:
24+
- class_path: pytorch_lightning.callbacks.EarlyStopping
25+
init_args:
26+
monitor: bleu/val
27+
mode: max
28+
min_delta: 0
29+
patience: 5
30+
verbose: true
31+
# - class_path: pytorch_lightning.callbacks.StochasticWeightAveraging # Incompatible with EarlyStopping
32+
- class_path: pytorch_lightning.callbacks.lr_monitor.LearningRateMonitor
33+
init_args:
34+
logging_interval: step
35+
36+
optimizer:
37+
class_path: transformers.optimization.AdamW
38+
init_args:
39+
lr: 0.00005
40+
eps: 1e-8
41+
weight_decay: 0.01
42+
43+
lr_scheduler:
44+
class_path: torch.optim.lr_scheduler.OneCycleLR
45+
init_args:
46+
max_lr: 0.00005
47+
pct_start: 0.1
48+
div_factor: 1
49+
total_steps: 30
50+
anneal_strategy: linear
51+
52+
ckpt:
53+
save_top_k: 1
54+
monitor: bleu/val
55+
mode: max

python/configs/coditT5.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
data:
2+
batch_size: 1
3+
eval_batch_size: 1
4+
5+
model:
6+
pretrained_model: ../models/pretrain/model/
7+
pretrained_tokenizer: ../models/codeT5Tokenizer
8+
beam_size: 20
9+
skip_special_token_when_generate: False
10+
11+
trainer:
12+
auto_select_gpus: true
13+
gpus: -1
14+
strategy: ddp
15+
# find_unused_parameters: false
16+
precision: 16
17+
18+
# max_steps: 50_000
19+
# fast_dev_run: true
20+
max_epochs: 30
21+
accumulate_grad_batches: 12 # effective batch size 1*4(gpu)*12(accumulate) = 48
22+
23+
callbacks:
24+
- class_path: pytorch_lightning.callbacks.EarlyStopping
25+
init_args:
26+
monitor: bleu/val
27+
mode: max
28+
min_delta: 0
29+
patience: 5
30+
verbose: true
31+
# - class_path: pytorch_lightning.callbacks.StochasticWeightAveraging # Incompatible with EarlyStopping
32+
- class_path: pytorch_lightning.callbacks.lr_monitor.LearningRateMonitor
33+
init_args:
34+
logging_interval: step
35+
36+
optimizer:
37+
class_path: transformers.optimization.AdamW
38+
init_args:
39+
lr: 0.00005
40+
eps: 1e-8
41+
weight_decay: 0.01
42+
43+
lr_scheduler:
44+
class_path: torch.optim.lr_scheduler.OneCycleLR
45+
init_args:
46+
max_lr: 0.00005
47+
pct_start: 0.1
48+
div_factor: 1
49+
total_steps: 50
50+
anneal_strategy: linear
51+
52+
ckpt:
53+
save_top_k: 1
54+
monitor: bleu/val
55+
mode: max

0 commit comments

Comments
 (0)