LEESM commited on
Commit
ef5d152
โ€ข
1 Parent(s): 43368d5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -38
README.md CHANGED
@@ -10,19 +10,19 @@ tags:
10
  - LoRA
11
  ---
12
 
13
- # Llama-2-7b-hf ๋ชจ๋ธ์„ ์ด์šฉํ•œ LoRA ํŒŒ์ธ ํŠœ๋‹ (์„œ์šธ์‚ฌ์ด๋ฒ„๋Œ€ํ•™๊ต TREX-Lab)
14
 
15
  <!-- Provide a quick summary of what the model is/does. -->
16
 
17
- ## ํŒŒ์ธ ํŠœ๋‹ ๊ฐœ์š”
18
- - ๊ธฐ๋ณธ ๋ชจ๋ธ : meta-llama/Llama-2-7b-hf
19
- - ๋ฐ์ดํ„ฐ์…‹ : heegyu/open-korean-instructions (10%)
20
- - ํŠœ๋‹ ๋ฐฉ๋ฒ•
21
  - PEFT(Parameter Efficient Fine-Tuning)
22
  - LoRA(Low-Rank Adaptation of Large Language Models)
23
- - ๊ด€๋ จ ๋…ผ๋ฌธ : https://arxiv.org/abs/2106.09685
24
- - Llama2 ๋ชจ๋ธ์„ ํ•œ๊ตญ์–ด ์ฑ—๋ด‡ ๋ฐ์ดํ„ฐ(open korean instructions)์˜ ์ž„์˜ 10%๋กœ ํŒŒ์ธ ํŠœ๋‹
25
- - ๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์„ A30 GPU*1 ์—์„œ ํŒŒ์ธ ํŠœ๋‹์ด ๊ฐ€๋Šฅํ•œ์ง€ ํ…Œ์ŠคํŠธ (์„ฑ๊ณต)
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
- - ์•ŒํŒŒ๊ฐ’์„ 16์œผ๋กœ ์„ค์ •
36
- - r ๊ฐ’์„ 64๋กœ ์„ค์ • (์ข€ ํฐ ๋“ฏ...ใ… ใ… )
37
  ```
38
  peft_config = LoraConfig(
39
  lora_alpha=16,
@@ -44,7 +44,7 @@ peft_config = LoraConfig(
44
  )
45
  ```
46
 
47
- - Mixed precision ์„ค์ • : 4bit ์ •๋ฐ€๋„ (bnb_4bit_use_double_quant๋กœ ์ค‘๋ณต ์–‘์ž ์„ค์ •)
48
  ```
49
  bnb_config = BitsAndBytesConfig(
50
  load_in_4bit=True,
@@ -54,30 +54,7 @@ bnb_config = BitsAndBytesConfig(
54
  )
55
  ```
56
 
57
- - 3 epoch ์ˆ˜ํ–‰
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
- ์†Œ์š”์‹œ๊ฐ„ : executed in 2d 0h 17m
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
  ```