Upload 2 files
Browse files- training_infos.md +89 -0
- training_log.json +146 -0
training_infos.md
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Promt Format
|
2 |
+
```
|
3 |
+
alpaca_prompt = """Sen bir doktorsun. Soruları buna göre cevapla.
|
4 |
+
### Soru:
|
5 |
+
{}
|
6 |
+
|
7 |
+
### Cevap:
|
8 |
+
{}"""
|
9 |
+
```
|
10 |
+
|
11 |
+
# Training args
|
12 |
+
```
|
13 |
+
batch_size = 128
|
14 |
+
gradient_accumulation_steps = 32
|
15 |
+
num_train_epochs = 2
|
16 |
+
per_device_batch_size = int(batch_size / gradient_accumulation_steps)
|
17 |
+
training_args = TrainingArguments(
|
18 |
+
per_device_train_batch_size = per_device_batch_size,
|
19 |
+
per_device_eval_batch_size = per_device_batch_size,
|
20 |
+
gradient_accumulation_steps = gradient_accumulation_steps,
|
21 |
+
save_total_limit = 1,
|
22 |
+
warmup_steps = int(2000 / batch_size),
|
23 |
+
num_train_epochs = num_train_epochs,
|
24 |
+
learning_rate = 1e-4,
|
25 |
+
fp16 = not is_bfloat16_supported(),
|
26 |
+
bf16 = is_bfloat16_supported(),
|
27 |
+
optim = "adamw_8bit",
|
28 |
+
weight_decay = 0.01,
|
29 |
+
lr_scheduler_type = "linear",
|
30 |
+
seed = 3407,
|
31 |
+
output_dir = output_dir,
|
32 |
+
save_strategy = "steps",
|
33 |
+
eval_strategy = "steps",
|
34 |
+
logging_strategy = "steps",
|
35 |
+
save_steps = int(5000 / batch_size * num_train_epochs),
|
36 |
+
eval_steps = int(28900 / batch_size * num_train_epochs),
|
37 |
+
logging_steps = int(28900 / batch_size * num_train_epochs),
|
38 |
+
)
|
39 |
+
```
|
40 |
+
|
41 |
+
# Trainer args
|
42 |
+
|
43 |
+
```
|
44 |
+
max_seq_length = 4096
|
45 |
+
trainer = SFTTrainer(
|
46 |
+
model = model,
|
47 |
+
tokenizer = tokenizer,
|
48 |
+
train_dataset = train_dataset,
|
49 |
+
eval_dataset = eval_dataset,
|
50 |
+
dataset_text_field = "text",
|
51 |
+
max_seq_length = max_seq_length,
|
52 |
+
dataset_num_proc = 1,
|
53 |
+
packing = False, # Can make training 5x faster for short sequences.
|
54 |
+
args = training_args
|
55 |
+
)
|
56 |
+
```
|
57 |
+
|
58 |
+
# From pretrained args
|
59 |
+
|
60 |
+
```
|
61 |
+
from unsloth import FastLanguageModel
|
62 |
+
max_seq_length = 4096
|
63 |
+
dtype = None
|
64 |
+
load_in_4bit = False
|
65 |
+
|
66 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
67 |
+
model_name = output_dir,
|
68 |
+
max_seq_length = max_seq_length,
|
69 |
+
dtype = dtype,
|
70 |
+
load_in_4bit = load_in_4bit,
|
71 |
+
)
|
72 |
+
```
|
73 |
+
# Get peft model args
|
74 |
+
|
75 |
+
```
|
76 |
+
model = FastLanguageModel.get_peft_model(
|
77 |
+
model,
|
78 |
+
r = 8,
|
79 |
+
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
|
80 |
+
"gate_proj", "up_proj", "down_proj",],
|
81 |
+
lora_alpha = 16,
|
82 |
+
lora_dropout = 0,
|
83 |
+
bias = "none",
|
84 |
+
use_gradient_checkpointing = True,
|
85 |
+
random_state = 3407,
|
86 |
+
use_rslora = False,
|
87 |
+
loftq_config = None,
|
88 |
+
)
|
89 |
+
```
|
training_log.json
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"loss": 2.0071,
|
4 |
+
"grad_norm": 0.4352966547012329,
|
5 |
+
"learning_rate": 8.923190911336132e-5,
|
6 |
+
"epoch": 0.2218976306523778,
|
7 |
+
"step": 451
|
8 |
+
},
|
9 |
+
{
|
10 |
+
"eval_loss": 1.9273011684417725,
|
11 |
+
"eval_runtime": 896.6751,
|
12 |
+
"eval_samples_per_second": 32.238,
|
13 |
+
"eval_steps_per_second": 8.06,
|
14 |
+
"epoch": 0.2218976306523778,
|
15 |
+
"step": 451
|
16 |
+
},
|
17 |
+
{
|
18 |
+
"loss": 1.9032,
|
19 |
+
"grad_norm": 0.43635115027427673,
|
20 |
+
"learning_rate": 7.809335638429242e-5,
|
21 |
+
"epoch": 0.4437952613047556,
|
22 |
+
"step": 902
|
23 |
+
},
|
24 |
+
{
|
25 |
+
"eval_loss": 1.8892905712127686,
|
26 |
+
"eval_runtime": 896.4291,
|
27 |
+
"eval_samples_per_second": 32.247,
|
28 |
+
"eval_steps_per_second": 8.062,
|
29 |
+
"epoch": 0.4437952613047556,
|
30 |
+
"step": 902
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"loss": 1.8749,
|
34 |
+
"grad_norm": 0.4370776116847992,
|
35 |
+
"learning_rate": 6.695480365522352e-5,
|
36 |
+
"epoch": 0.6656928919571334,
|
37 |
+
"step": 1353
|
38 |
+
},
|
39 |
+
{
|
40 |
+
"eval_loss": 1.866470217704773,
|
41 |
+
"eval_runtime": 899.5289,
|
42 |
+
"eval_samples_per_second": 32.136,
|
43 |
+
"eval_steps_per_second": 8.034,
|
44 |
+
"epoch": 0.6656928919571334,
|
45 |
+
"step": 1353
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"loss": 1.8578,
|
49 |
+
"grad_norm": 0.45984092354774475,
|
50 |
+
"learning_rate": 5.581625092615461e-5,
|
51 |
+
"epoch": 0.8875905226095112,
|
52 |
+
"step": 1804
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"eval_loss": 1.850355863571167,
|
56 |
+
"eval_runtime": 899.8612,
|
57 |
+
"eval_samples_per_second": 32.124,
|
58 |
+
"eval_steps_per_second": 8.031,
|
59 |
+
"epoch": 0.8875905226095112,
|
60 |
+
"step": 1804
|
61 |
+
},
|
62 |
+
{
|
63 |
+
"loss": 1.8145,
|
64 |
+
"grad_norm": 0.4957409203052521,
|
65 |
+
"learning_rate": 4.4677698197085704e-5,
|
66 |
+
"epoch": 1.109488153261889,
|
67 |
+
"step": 2255
|
68 |
+
},
|
69 |
+
{
|
70 |
+
"eval_loss": 1.8413817882537842,
|
71 |
+
"eval_runtime": 896.594,
|
72 |
+
"eval_samples_per_second": 32.241,
|
73 |
+
"eval_steps_per_second": 8.061,
|
74 |
+
"epoch": 1.109488153261889,
|
75 |
+
"step": 2255
|
76 |
+
},
|
77 |
+
{
|
78 |
+
"loss": 1.7791,
|
79 |
+
"grad_norm": 0.5043504238128662,
|
80 |
+
"learning_rate": 3.3539145468016795e-5,
|
81 |
+
"epoch": 1.3313857839142669,
|
82 |
+
"step": 2706
|
83 |
+
},
|
84 |
+
{
|
85 |
+
"eval_loss": 1.8332940340042114,
|
86 |
+
"eval_runtime": 898.6194,
|
87 |
+
"eval_samples_per_second": 32.168,
|
88 |
+
"eval_steps_per_second": 8.042,
|
89 |
+
"epoch": 1.3313857839142669,
|
90 |
+
"step": 2706
|
91 |
+
},
|
92 |
+
{
|
93 |
+
"loss": 1.7728,
|
94 |
+
"grad_norm": 0.5073263049125671,
|
95 |
+
"learning_rate": 2.240059273894789e-5,
|
96 |
+
"epoch": 1.5532834145666445,
|
97 |
+
"step": 3157
|
98 |
+
},
|
99 |
+
{
|
100 |
+
"eval_loss": 1.8273794651031494,
|
101 |
+
"eval_runtime": 899.231,
|
102 |
+
"eval_samples_per_second": 32.146,
|
103 |
+
"eval_steps_per_second": 8.037,
|
104 |
+
"epoch": 1.5532834145666445,
|
105 |
+
"step": 3157
|
106 |
+
},
|
107 |
+
{
|
108 |
+
"loss": 1.7671,
|
109 |
+
"grad_norm": 0.5197569131851196,
|
110 |
+
"learning_rate": 1.1262040009878982e-5,
|
111 |
+
"epoch": 1.7751810452190224,
|
112 |
+
"step": 3608
|
113 |
+
},
|
114 |
+
{
|
115 |
+
"eval_loss": 1.8234010934829712,
|
116 |
+
"eval_runtime": 899.3422,
|
117 |
+
"eval_samples_per_second": 32.142,
|
118 |
+
"eval_steps_per_second": 8.036,
|
119 |
+
"epoch": 1.7751810452190224,
|
120 |
+
"step": 3608
|
121 |
+
},
|
122 |
+
{
|
123 |
+
"loss": 1.7679,
|
124 |
+
"grad_norm": 0.5240359306335449,
|
125 |
+
"learning_rate": 1.2348728081007656e-7,
|
126 |
+
"epoch": 1.9970786758714003,
|
127 |
+
"step": 4059
|
128 |
+
},
|
129 |
+
{
|
130 |
+
"eval_loss": 1.8216350078582764,
|
131 |
+
"eval_runtime": 897.3741,
|
132 |
+
"eval_samples_per_second": 32.213,
|
133 |
+
"eval_steps_per_second": 8.053,
|
134 |
+
"epoch": 1.9970786758714003,
|
135 |
+
"step": 4059
|
136 |
+
},
|
137 |
+
{
|
138 |
+
"train_runtime": 62857.4586,
|
139 |
+
"train_samples_per_second": 8.278,
|
140 |
+
"train_steps_per_second": 0.065,
|
141 |
+
"total_flos": 7.055063070229955e18,
|
142 |
+
"train_loss": 1.8381839976536007,
|
143 |
+
"epoch": 1.9995387382954841,
|
144 |
+
"step": 4064
|
145 |
+
}
|
146 |
+
]
|