-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefaults.py
More file actions
33 lines (31 loc) · 873 Bytes
/
defaults.py
File metadata and controls
33 lines (31 loc) · 873 Bytes
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
def get_default_LORA_config():
return {
"r": 16, # attention heads
"lora_alpha": 32, # alpha scaling
"lora_dropout": 0.05,
"bias": "none",
"task_type": "FEATURE_EXTRACTION",
}
def get_default_training_args():
return {
"per_device_train_batch_size": 1,
"gradient_accumulation_steps": 4,
"warmup_steps": 0,
"max_steps": 300,
"learning_rate": 2e-5,
"fp16": True,
"logging_steps": 1,
"optim": "paged_adamw_8bit",
"save_strategy": "epoch",
"ddp_find_unused_parameters": False,
"push_to_hub": False,
}
def get_default_generation_config():
return {
"penalty_alpha": 0.6,
"do_sample": True,
"top_k": 5,
"temperature": 0.1,
"repetition_penalty": 10.2,
"max_new_tokens": 200,
}