danielgombas
commited on
Commit
•
f8c4f2e
1
Parent(s):
90af70f
danielgombas/llama_3b_step2_batch_v5
Browse files- .ipynb_checkpoints/args_v5-checkpoint.txt +71 -0
- README.md +50 -178
- args_v5.txt +71 -0
- training_args.bin +3 -0
.ipynb_checkpoints/args_v5-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 = 8,
|
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_v5",
|
70 |
+
),
|
71 |
+
)
|
README.md
CHANGED
@@ -3,199 +3,71 @@ library_name: transformers
|
|
3 |
tags:
|
4 |
- trl
|
5 |
- sft
|
|
|
|
|
|
|
|
|
6 |
---
|
7 |
|
8 |
-
|
|
|
9 |
|
10 |
-
|
11 |
|
|
|
|
|
|
|
12 |
|
|
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
|
22 |
-
|
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 |
-
|
31 |
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
-
|
36 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
### Direct Use
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
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_v5
|
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_v5
|
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.3275
|
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: 8
|
40 |
+
- eval_batch_size: 40
|
41 |
+
- seed: 42
|
42 |
+
- gradient_accumulation_steps: 4
|
43 |
+
- total_train_batch_size: 32
|
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.9071 | 0.1363 | 50 | 0.8211 |
|
53 |
+
| 0.7063 | 0.2727 | 100 | 0.6140 |
|
54 |
+
| 0.5548 | 0.4090 | 150 | 0.5100 |
|
55 |
+
| 0.3776 | 0.5453 | 200 | 0.4445 |
|
56 |
+
| 0.4611 | 0.6817 | 250 | 0.4011 |
|
57 |
+
| 0.3701 | 0.8180 | 300 | 0.3742 |
|
58 |
+
| 0.325 | 0.9543 | 350 | 0.3529 |
|
59 |
+
| 0.2093 | 1.0913 | 400 | 0.3522 |
|
60 |
+
| 0.2459 | 1.2277 | 450 | 0.3428 |
|
61 |
+
| 0.201 | 1.3640 | 500 | 0.3355 |
|
62 |
+
| 0.2741 | 1.5003 | 550 | 0.3312 |
|
63 |
+
| 0.2596 | 1.6367 | 600 | 0.3283 |
|
64 |
+
| 0.2138 | 1.7730 | 650 | 0.3281 |
|
65 |
+
| 0.2181 | 1.9093 | 700 | 0.3275 |
|
66 |
|
|
|
67 |
|
68 |
+
### Framework versions
|
69 |
|
70 |
+
- Transformers 4.46.1
|
71 |
+
- Pytorch 2.1.0+cu118
|
72 |
+
- Datasets 3.0.2
|
73 |
+
- Tokenizers 0.20.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
args_v5.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 = 8,
|
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_v5",
|
70 |
+
),
|
71 |
+
)
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:832a30bb60d5864768eaa31f7df7d4cf60ceae4e278aa87b958e9e6ab963fdcd
|
3 |
+
size 5240
|