Update README.md
Browse files
README.md
CHANGED
@@ -10,19 +10,19 @@ tags:
|
|
10 |
- LoRA
|
11 |
---
|
12 |
|
13 |
-
# Llama-2-7b-hf
|
14 |
|
15 |
<!-- Provide a quick summary of what the model is/does. -->
|
16 |
|
17 |
-
##
|
18 |
-
-
|
19 |
-
-
|
20 |
-
-
|
21 |
- PEFT(Parameter Efficient Fine-Tuning)
|
22 |
- LoRA(Low-Rank Adaptation of Large Language Models)
|
23 |
-
-
|
24 |
-
- Llama2
|
25 |
-
-
|
26 |
|
27 |
<!-- Provide a longer summary of what this model is. -->
|
28 |
|
@@ -30,10 +30,10 @@ tags:
|
|
30 |
- **Language(s) (NLP):** [Korean]
|
31 |
- **Finetuned from model :** [meta-llama/Llama-2-7b-hf]
|
32 |
|
33 |
-
##
|
34 |
|
35 |
-
-
|
36 |
-
- r
|
37 |
```
|
38 |
peft_config = LoraConfig(
|
39 |
lora_alpha=16,
|
@@ -44,7 +44,7 @@ peft_config = LoraConfig(
|
|
44 |
)
|
45 |
```
|
46 |
|
47 |
-
- Mixed precision
|
48 |
```
|
49 |
bnb_config = BitsAndBytesConfig(
|
50 |
load_in_4bit=True,
|
@@ -54,30 +54,7 @@ bnb_config = BitsAndBytesConfig(
|
|
54 |
)
|
55 |
```
|
56 |
|
57 |
-
-
|
58 |
-
```
|
59 |
-
training_args = TrainingArguments(
|
60 |
-
output_dir=fine_tuning_model_name,
|
61 |
-
num_train_epochs=3,
|
62 |
-
per_device_train_batch_size=4,
|
63 |
-
gradient_accumulation_steps=2,
|
64 |
-
gradient_checkpointing=True,
|
65 |
-
optim='paged_adamw_32bit',
|
66 |
-
logging_steps=5,
|
67 |
-
save_strategy='epoch',
|
68 |
-
learning_rate=2e-4,
|
69 |
-
weight_decay=0.001,
|
70 |
-
max_grad_norm=0.3,
|
71 |
-
warmup_ratio=0.03,
|
72 |
-
group_by_length=False,
|
73 |
-
lr_scheduler_type='cosine',
|
74 |
-
disable_tqdm=True,
|
75 |
-
report_to='wandb',
|
76 |
-
seed=42
|
77 |
-
)
|
78 |
-
```
|
79 |
-
|
80 |
-
- ๊ธฐ๋ณธ Trainer๋์ SFTํธ๋ ์ด๋ ์ฌ์ฉ (https://huggingface.co/docs/trl/sft_trainer)
|
81 |
```
|
82 |
trainer = SFTTrainer(
|
83 |
model=peft_model,
|
@@ -90,10 +67,10 @@ trainer = SFTTrainer(
|
|
90 |
)
|
91 |
```
|
92 |
|
93 |
-
###
|
94 |
|
95 |
```
|
96 |
-
|
97 |
```
|
98 |
|
99 |
```
|
|
|
10 |
- LoRA
|
11 |
---
|
12 |
|
13 |
+
# LoRA fine tuning using the Llama-2-7b-hf model (Seoul Cyber University TREX-Lab)
|
14 |
|
15 |
<!-- Provide a quick summary of what the model is/does. -->
|
16 |
|
17 |
+
## Summary
|
18 |
+
- Base Model : meta-llama/Llama-2-7b-hf
|
19 |
+
- Dataset : heegyu/open-korean-instructions (10%)
|
20 |
+
- Tuning Method
|
21 |
- PEFT(Parameter Efficient Fine-Tuning)
|
22 |
- LoRA(Low-Rank Adaptation of Large Language Models)
|
23 |
+
- Related Articles : https://arxiv.org/abs/2106.09685
|
24 |
+
- Fine-tuning the Llama2 model with a random 10% of Korean chatbot data (open Korean instructions)
|
25 |
+
- Test whether fine tuning of a large language model is possible on A30 GPU*1 (successful)
|
26 |
|
27 |
<!-- Provide a longer summary of what this model is. -->
|
28 |
|
|
|
30 |
- **Language(s) (NLP):** [Korean]
|
31 |
- **Finetuned from model :** [meta-llama/Llama-2-7b-hf]
|
32 |
|
33 |
+
## Fine Tuning Detail
|
34 |
|
35 |
+
- alpha value 16
|
36 |
+
- r value 64 (it seems a bit big...@@)
|
37 |
```
|
38 |
peft_config = LoraConfig(
|
39 |
lora_alpha=16,
|
|
|
44 |
)
|
45 |
```
|
46 |
|
47 |
+
- Mixed precision : 4bit (bnb_4bit_use_double_quant)
|
48 |
```
|
49 |
bnb_config = BitsAndBytesConfig(
|
50 |
load_in_4bit=True,
|
|
|
54 |
)
|
55 |
```
|
56 |
|
57 |
+
- Use SFT trainer (https://huggingface.co/docs/trl/sft_trainer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
```
|
59 |
trainer = SFTTrainer(
|
60 |
model=peft_model,
|
|
|
67 |
)
|
68 |
```
|
69 |
|
70 |
+
### Train Result
|
71 |
|
72 |
```
|
73 |
+
time taken : executed in 2d 0h 17m
|
74 |
```
|
75 |
|
76 |
```
|