danielgombas commited on
Commit
8d2f225
·
verified ·
1 Parent(s): 6280088

danielgombas/llama_3b_step2_batch_v2

Browse files
.ipynb_checkpoints/args_v2-checkpoint.txt ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ max_seq_length = 500
2
+
3
+ def fmt(examples):
4
+ print(len(examples))
5
+ return examples
6
+
7
+ # 'lora_r' is the dimension of the LoRA attention.
8
+ lora_r = 32
9
+
10
+ # 'lora_alpha' is the alpha parameter for LoRA scaling.
11
+ lora_alpha = 16
12
+
13
+ # 'lora_dropout' is the dropout probability for LoRA layers.
14
+ lora_dropout = 0.05
15
+
16
+ # 'target_modules' is a list of the modules that should be targeted by LoRA.
17
+ target_modules= ['k_proj', 'q_proj', 'v_proj', 'o_proj', "gate_proj", "down_proj", "up_proj"]
18
+
19
+ # 'se
20
+
21
+ peft_config = LoraConfig(
22
+ r=lora_r,
23
+ lora_alpha=lora_alpha,
24
+ lora_dropout=lora_dropout,
25
+ task_type=TaskType.CAUSAL_LM,
26
+ target_modules=target_modules,
27
+ )
28
+
29
+ trainer = SFTTrainer(
30
+ model = model,
31
+ tokenizer = tokenizer,
32
+ train_dataset = qa_dataset['train'],
33
+ eval_dataset = qa_dataset['test'],
34
+ dataset_text_field = "text",
35
+ max_seq_length = max_seq_length,
36
+ dataset_num_proc = 4,
37
+ data_collator = collator,
38
+ # formatting_func = fmt,
39
+ # peft_config=peft_config,
40
+ args = TrainingArguments(
41
+ per_device_train_batch_size = 2,
42
+ gradient_checkpointing = True,
43
+ gradient_accumulation_steps = 4,
44
+ per_device_eval_batch_size = 40,
45
+ do_eval = True,
46
+ eval_strategy = 'steps',
47
+ eval_steps = 50,
48
+ # save_strategy = 'steps',
49
+ save_steps = 1000,
50
+
51
+ # Use num_train_epochs and warmup_ratio for longer runs!
52
+ # max_steps = 70,
53
+ # warmup_steps = 10,
54
+ # warmup_ratio = 0.1,
55
+ num_train_epochs = 2,
56
+
57
+ # Select a 2 to 10x smaller learning rate for the embedding matrices!
58
+ learning_rate = 3e-5,
59
+ # embedding_learning_rate = 1e-6,
60
+
61
+ # fp16 = not is_bfloat16_supported(),
62
+ bf16 = True,
63
+ logging_steps = 1,
64
+ optim = "adamw_torch",
65
+ weight_decay = 0.00,
66
+ lr_scheduler_type = "linear",
67
+ # seed = 3407,
68
+
69
+ output_dir = "llama_3b_step2_batch_v2",
70
+ ),
71
+ )
README.md CHANGED
@@ -3,199 +3,115 @@ library_name: transformers
3
  tags:
4
  - trl
5
  - sft
 
 
 
 
6
  ---
7
 
8
- # Model Card for Model ID
9
-
10
- <!-- Provide a quick summary of what the model is/does. -->
11
-
12
-
13
-
14
- ## Model Details
15
-
16
- ### Model Description
17
-
18
- <!-- Provide a longer summary of what this model is. -->
19
-
20
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
21
-
22
- - **Developed by:** [More Information Needed]
23
- - **Funded by [optional]:** [More Information Needed]
24
- - **Shared by [optional]:** [More Information Needed]
25
- - **Model type:** [More Information Needed]
26
- - **Language(s) (NLP):** [More Information Needed]
27
- - **License:** [More Information Needed]
28
- - **Finetuned from model [optional]:** [More Information Needed]
29
-
30
- ### Model Sources [optional]
31
-
32
- <!-- Provide the basic links for the model. -->
33
-
34
- - **Repository:** [More Information Needed]
35
- - **Paper [optional]:** [More Information Needed]
36
- - **Demo [optional]:** [More Information Needed]
37
-
38
- ## Uses
39
-
40
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
41
-
42
- ### Direct Use
43
-
44
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
45
-
46
- [More Information Needed]
47
-
48
- ### Downstream Use [optional]
49
-
50
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
51
-
52
- [More Information Needed]
53
-
54
- ### Out-of-Scope Use
55
-
56
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
57
-
58
- [More Information Needed]
59
-
60
- ## Bias, Risks, and Limitations
61
-
62
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
63
-
64
- [More Information Needed]
65
-
66
- ### Recommendations
67
-
68
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
69
-
70
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
71
-
72
- ## How to Get Started with the Model
73
-
74
- Use the code below to get started with the model.
75
-
76
- [More Information Needed]
77
-
78
- ## Training Details
79
-
80
- ### Training Data
81
-
82
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
83
-
84
- [More Information Needed]
85
-
86
- ### Training Procedure
87
-
88
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
89
-
90
- #### Preprocessing [optional]
91
-
92
- [More Information Needed]
93
-
94
-
95
- #### Training Hyperparameters
96
-
97
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
98
-
99
- #### Speeds, Sizes, Times [optional]
100
-
101
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
102
-
103
- [More Information Needed]
104
-
105
- ## Evaluation
106
-
107
- <!-- This section describes the evaluation protocols and provides the results. -->
108
-
109
- ### Testing Data, Factors & Metrics
110
-
111
- #### Testing Data
112
-
113
- <!-- This should link to a Dataset Card if possible. -->
114
-
115
- [More Information Needed]
116
-
117
- #### Factors
118
-
119
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
120
-
121
- [More Information Needed]
122
-
123
- #### Metrics
124
-
125
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
126
-
127
- [More Information Needed]
128
-
129
- ### Results
130
-
131
- [More Information Needed]
132
-
133
- #### Summary
134
-
135
-
136
-
137
- ## Model Examination [optional]
138
-
139
- <!-- Relevant interpretability work for the model goes here -->
140
-
141
- [More Information Needed]
142
-
143
- ## Environmental Impact
144
-
145
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
146
-
147
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
148
-
149
- - **Hardware Type:** [More Information Needed]
150
- - **Hours used:** [More Information Needed]
151
- - **Cloud Provider:** [More Information Needed]
152
- - **Compute Region:** [More Information Needed]
153
- - **Carbon Emitted:** [More Information Needed]
154
-
155
- ## Technical Specifications [optional]
156
-
157
- ### Model Architecture and Objective
158
-
159
- [More Information Needed]
160
-
161
- ### Compute Infrastructure
162
-
163
- [More Information Needed]
164
-
165
- #### Hardware
166
-
167
- [More Information Needed]
168
-
169
- #### Software
170
-
171
- [More Information Needed]
172
-
173
- ## Citation [optional]
174
-
175
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
176
-
177
- **BibTeX:**
178
-
179
- [More Information Needed]
180
-
181
- **APA:**
182
-
183
- [More Information Needed]
184
-
185
- ## Glossary [optional]
186
-
187
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
188
-
189
- [More Information Needed]
190
-
191
- ## More Information [optional]
192
-
193
- [More Information Needed]
194
-
195
- ## Model Card Authors [optional]
196
-
197
- [More Information Needed]
198
-
199
- ## Model Card Contact
200
-
201
- [More Information Needed]
 
3
  tags:
4
  - trl
5
  - sft
6
+ - generated_from_trainer
7
+ model-index:
8
+ - name: llama_3b_step2_batch_v2
9
+ results: []
10
  ---
11
 
12
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
+ should probably proofread and complete it, then remove this comment. -->
14
+
15
+ # llama_3b_step2_batch_v2
16
+
17
+ This model was trained from scratch on an unknown dataset.
18
+ It achieves the following results on the evaluation set:
19
+ - Loss: 0.3132
20
+
21
+ ## Model description
22
+
23
+ More information needed
24
+
25
+ ## Intended uses & limitations
26
+
27
+ More information needed
28
+
29
+ ## Training and evaluation data
30
+
31
+ More information needed
32
+
33
+ ## Training procedure
34
+
35
+ ### Training hyperparameters
36
+
37
+ The following hyperparameters were used during training:
38
+ - learning_rate: 3e-05
39
+ - train_batch_size: 2
40
+ - eval_batch_size: 40
41
+ - seed: 42
42
+ - gradient_accumulation_steps: 4
43
+ - total_train_batch_size: 8
44
+ - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
45
+ - lr_scheduler_type: linear
46
+ - num_epochs: 2
47
+
48
+ ### Training results
49
+
50
+ | Training Loss | Epoch | Step | Validation Loss |
51
+ |:-------------:|:------:|:----:|:---------------:|
52
+ | 0.993 | 0.0341 | 50 | 1.1011 |
53
+ | 1.0449 | 0.0682 | 100 | 0.9752 |
54
+ | 0.9894 | 0.1023 | 150 | 0.8698 |
55
+ | 0.6199 | 0.1364 | 200 | 0.7913 |
56
+ | 0.5326 | 0.1704 | 250 | 0.7341 |
57
+ | 0.8109 | 0.2045 | 300 | 0.6799 |
58
+ | 0.7554 | 0.2386 | 350 | 0.6332 |
59
+ | 0.9877 | 0.2727 | 400 | 0.5993 |
60
+ | 0.3571 | 0.3068 | 450 | 0.5726 |
61
+ | 0.4539 | 0.3409 | 500 | 0.5439 |
62
+ | 0.464 | 0.3750 | 550 | 0.5147 |
63
+ | 0.4051 | 0.4091 | 600 | 0.4904 |
64
+ | 0.5371 | 0.4432 | 650 | 0.4732 |
65
+ | 0.4954 | 0.4772 | 700 | 0.4549 |
66
+ | 0.4594 | 0.5113 | 750 | 0.4399 |
67
+ | 0.4755 | 0.5454 | 800 | 0.4281 |
68
+ | 0.2948 | 0.5795 | 850 | 0.4118 |
69
+ | 0.3699 | 0.6136 | 900 | 0.4021 |
70
+ | 0.319 | 0.6477 | 950 | 0.3927 |
71
+ | 0.3359 | 0.6818 | 1000 | 0.3802 |
72
+ | 0.4056 | 0.7159 | 1050 | 0.3746 |
73
+ | 0.2975 | 0.7500 | 1100 | 0.3643 |
74
+ | 0.3868 | 0.7840 | 1150 | 0.3596 |
75
+ | 0.3485 | 0.8181 | 1200 | 0.3512 |
76
+ | 0.3546 | 0.8522 | 1250 | 0.3476 |
77
+ | 0.3697 | 0.8863 | 1300 | 0.3416 |
78
+ | 0.4056 | 0.9204 | 1350 | 0.3388 |
79
+ | 0.3189 | 0.9545 | 1400 | 0.3332 |
80
+ | 0.4173 | 0.9886 | 1450 | 0.3286 |
81
+ | 0.1779 | 1.0228 | 1500 | 0.3338 |
82
+ | 0.2877 | 1.0569 | 1550 | 0.3300 |
83
+ | 0.1506 | 1.0910 | 1600 | 0.3301 |
84
+ | 0.2075 | 1.1251 | 1650 | 0.3289 |
85
+ | 0.1956 | 1.1592 | 1700 | 0.3271 |
86
+ | 0.162 | 1.1933 | 1750 | 0.3276 |
87
+ | 0.2416 | 1.2274 | 1800 | 0.3228 |
88
+ | 0.2364 | 1.2615 | 1850 | 0.3243 |
89
+ | 0.1602 | 1.2956 | 1900 | 0.3219 |
90
+ | 0.1566 | 1.3296 | 1950 | 0.3211 |
91
+ | 0.1784 | 1.3637 | 2000 | 0.3215 |
92
+ | 0.1627 | 1.3978 | 2050 | 0.3190 |
93
+ | 0.1907 | 1.4319 | 2100 | 0.3183 |
94
+ | 0.1182 | 1.4660 | 2150 | 0.3183 |
95
+ | 0.1585 | 1.5001 | 2200 | 0.3179 |
96
+ | 0.2261 | 1.5342 | 2250 | 0.3158 |
97
+ | 0.1457 | 1.5683 | 2300 | 0.3150 |
98
+ | 0.2589 | 1.6024 | 2350 | 0.3146 |
99
+ | 0.2253 | 1.6364 | 2400 | 0.3144 |
100
+ | 0.1741 | 1.6705 | 2450 | 0.3143 |
101
+ | 0.1477 | 1.7046 | 2500 | 0.3141 |
102
+ | 0.1886 | 1.7387 | 2550 | 0.3141 |
103
+ | 0.2211 | 1.7728 | 2600 | 0.3139 |
104
+ | 0.238 | 1.8069 | 2650 | 0.3138 |
105
+ | 0.2863 | 1.8410 | 2700 | 0.3137 |
106
+ | 0.2603 | 1.8751 | 2750 | 0.3135 |
107
+ | 0.2484 | 1.9092 | 2800 | 0.3133 |
108
+ | 0.2343 | 1.9432 | 2850 | 0.3132 |
109
+ | 0.254 | 1.9773 | 2900 | 0.3132 |
110
+
111
+
112
+ ### Framework versions
113
+
114
+ - Transformers 4.46.1
115
+ - Pytorch 2.1.0+cu118
116
+ - Datasets 3.0.2
117
+ - Tokenizers 0.20.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
args_v2.txt ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ max_seq_length = 500
2
+
3
+ def fmt(examples):
4
+ print(len(examples))
5
+ return examples
6
+
7
+ # 'lora_r' is the dimension of the LoRA attention.
8
+ lora_r = 32
9
+
10
+ # 'lora_alpha' is the alpha parameter for LoRA scaling.
11
+ lora_alpha = 16
12
+
13
+ # 'lora_dropout' is the dropout probability for LoRA layers.
14
+ lora_dropout = 0.05
15
+
16
+ # 'target_modules' is a list of the modules that should be targeted by LoRA.
17
+ target_modules= ['k_proj', 'q_proj', 'v_proj', 'o_proj', "gate_proj", "down_proj", "up_proj"]
18
+
19
+ # 'se
20
+
21
+ peft_config = LoraConfig(
22
+ r=lora_r,
23
+ lora_alpha=lora_alpha,
24
+ lora_dropout=lora_dropout,
25
+ task_type=TaskType.CAUSAL_LM,
26
+ target_modules=target_modules,
27
+ )
28
+
29
+ trainer = SFTTrainer(
30
+ model = model,
31
+ tokenizer = tokenizer,
32
+ train_dataset = qa_dataset['train'],
33
+ eval_dataset = qa_dataset['test'],
34
+ dataset_text_field = "text",
35
+ max_seq_length = max_seq_length,
36
+ dataset_num_proc = 4,
37
+ data_collator = collator,
38
+ # formatting_func = fmt,
39
+ # peft_config=peft_config,
40
+ args = TrainingArguments(
41
+ per_device_train_batch_size = 2,
42
+ gradient_checkpointing = True,
43
+ gradient_accumulation_steps = 4,
44
+ per_device_eval_batch_size = 40,
45
+ do_eval = True,
46
+ eval_strategy = 'steps',
47
+ eval_steps = 50,
48
+ # save_strategy = 'steps',
49
+ save_steps = 1000,
50
+
51
+ # Use num_train_epochs and warmup_ratio for longer runs!
52
+ # max_steps = 70,
53
+ # warmup_steps = 10,
54
+ # warmup_ratio = 0.1,
55
+ num_train_epochs = 2,
56
+
57
+ # Select a 2 to 10x smaller learning rate for the embedding matrices!
58
+ learning_rate = 3e-5,
59
+ # embedding_learning_rate = 1e-6,
60
+
61
+ # fp16 = not is_bfloat16_supported(),
62
+ bf16 = True,
63
+ logging_steps = 1,
64
+ optim = "adamw_torch",
65
+ weight_decay = 0.00,
66
+ lr_scheduler_type = "linear",
67
+ # seed = 3407,
68
+
69
+ output_dir = "llama_3b_step2_batch_v2",
70
+ ),
71
+ )
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fa39175d2ef0b886e4b9dd3b7b39382be9b1e33a3d2acf2ab7666712e70893d
3
+ size 5240