Update README.md
Browse files
README.md
CHANGED
@@ -3,4 +3,50 @@ license: llama2
|
|
3 |
datasets:
|
4 |
- vicgalle/alpaca-gpt4
|
5 |
pipeline_tag: text-generation
|
6 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
datasets:
|
4 |
- vicgalle/alpaca-gpt4
|
5 |
pipeline_tag: text-generation
|
6 |
+
---
|
7 |
+
## Fine-tuning
|
8 |
+
- Base Model: [NousResearch/Llama-2-7b-hf](https://huggingface.co/NousResearch/Llama-2-7b-hf)
|
9 |
+
- Dataset for fine-tuning: [vicgalle/alpaca-gpt4](https://huggingface.co/vicgalle/gpt2-alpaca-gpt4)
|
10 |
+
- Training
|
11 |
+
- BitsAndBytesConfig
|
12 |
+
```
|
13 |
+
BitsAndBytesConfig(
|
14 |
+
load_in_4bit= True,
|
15 |
+
bnb_4bit_quant_type= "nf4",
|
16 |
+
bnb_4bit_compute_dtype= torch.bfloat16,
|
17 |
+
bnb_4bit_use_double_quant= False,
|
18 |
+
)
|
19 |
+
```
|
20 |
+
- LoRA Config
|
21 |
+
```
|
22 |
+
LoraConfig(
|
23 |
+
r=16,
|
24 |
+
lora_alpha= 8, # alpha = rank * 2 !
|
25 |
+
lora_dropout= 0.1,
|
26 |
+
bias="none",
|
27 |
+
task_type="CAUSAL_LM",
|
28 |
+
target_modules=["q_proj", "k_proj", "v_proj", "o_proj","gate_proj", "up_proj"]
|
29 |
+
)
|
30 |
+
```
|
31 |
+
- Training Arguments
|
32 |
+
```
|
33 |
+
TrainingArguments(
|
34 |
+
output_dir= "./results",
|
35 |
+
num_train_epochs= 1,
|
36 |
+
per_device_train_batch_size= 8,
|
37 |
+
gradient_accumulation_steps= 2,
|
38 |
+
optim = "paged_adamw_8bit",
|
39 |
+
save_steps= 1000,
|
40 |
+
logging_steps= 30,
|
41 |
+
learning_rate= 2e-4,
|
42 |
+
weight_decay= 0.001,
|
43 |
+
fp16= False,
|
44 |
+
bf16= False,
|
45 |
+
max_grad_norm= 0.3,
|
46 |
+
max_steps= -1,
|
47 |
+
warmup_ratio= 0.3,
|
48 |
+
group_by_length= True,
|
49 |
+
lr_scheduler_type= "linear",
|
50 |
+
report_to="wandb",
|
51 |
+
)
|
52 |
+
```
|