File size: 4,830 Bytes
9a196d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
---
base_model: google/gemma-2-9b
library_name: peft
license: gemma
tags:
- generated_from_trainer
model-index:
- name: lora-out
  results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

[<img src="https://raw.githubusercontent.com/axolotl-ai-cloud/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/axolotl-ai-cloud/axolotl)
<details><summary>See axolotl config</summary>

axolotl version: `0.4.1`
```yaml
base_model: google/gemma-2-9b

sequence_len: 1024

# base model weight quantization
load_in_8bit: true
# load_in_4bit: true

# attention implementation
flash_attention: true

# finetuned adapter config
adapter: lora
lora_model_dir:
lora_r: 16
lora_alpha: 32
lora_dropout: 0.05
lora_target_linear: true
lora_fan_in_fan_out:
lora_modules_to_save: # required when adding new tokens to LLaMA/Mistral
  - embed_tokens
  - lm_head

# if training fails, uncomment above
# for details, see https://github.com/huggingface/peft/issues/334#issuecomment-1561727994

###
# Dataset Configuration: sqlqa
###
# datasets:
#   - path: data.jsonl
#     type: alpaca

datasets:
  - path: public_train_data.jsonl
    ds_type: json
    type:
      field_instruction: instruction
      field_input: input
      field_output: output
      format: |-
        [INST] {instruction}
        {input} [/INST]

chat_template: gemma
tokens:
  - "[INST]"
  - " [/INST]"
  - "[QL]"
  - " [/QL]"
  - "[EXPLANATION]"
  - " [/EXPLANATION]"
# dataset formatting config

special_tokens:
  pad_token: <|end_of_text|>

val_set_size: 0.05

###
# Training Configuration
###

# masks the input messages so that the model learns and understands the language w/o being reliant on the input
train_on_inputs: false
# random seed for better reproducibility
seed: 117

# optimizer config
optimizer: adamw_bnb_8bit
learning_rate: 0.0001
lr_scheduler: cosine
num_epochs: 4
micro_batch_size: 4
gradient_accumulation_steps: 1
warmup_steps: 10

# axolotl saving config
dataset_prepared_path: last_run_prepared
output_dir: ./lora-out

# logging and eval config
logging_steps: 1
eval_steps: 0.05

# training performance optimization config
bf16: auto
tf32: false
gradient_checkpointing: true

###
# Miscellaneous Configuration
###

# when true, prevents over-writing the config from the CLI
strict: false

# "Don't mess with this, it's here for accelerate and torchrun" -- axolotl docs
local_rank:

# WANDB
wandb_mode:
wandb_project:
wandb_watch:
wandb_name:
wandb_run_id:

# Multi-GPU
# deepspeed: /root/axolotl/deepspeed_configs/zero3_bf16.json
# deepspeed: zero3_bf16.json
# deepspeed: /workspace/axolotl/deepspeed_configs/zero2.json
deepspeed:
fsdp:
fsdp_config:

```

</details><br>

# lora-out

This model is a fine-tuned version of [google/gemma-2-9b](https://huggingface.co/google/gemma-2-9b) on the None dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0077

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 0.0001
- train_batch_size: 4
- eval_batch_size: 4
- seed: 117
- distributed_type: multi-GPU
- num_devices: 4
- total_train_batch_size: 16
- total_eval_batch_size: 16
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 10
- num_epochs: 4

### Training results

| Training Loss | Epoch  | Step | Validation Loss |
|:-------------:|:------:|:----:|:---------------:|
| 1.7925        | 0.0385 | 1    | 2.0412          |
| 1.6872        | 0.2308 | 6    | 1.6089          |
| 0.6967        | 0.4615 | 12   | 0.6328          |
| 0.3327        | 0.6923 | 18   | 0.2711          |
| 0.1784        | 0.9231 | 24   | 0.1733          |
| 0.1136        | 1.1538 | 30   | 0.1190          |
| 0.0891        | 1.3846 | 36   | 0.0850          |
| 0.0746        | 1.6154 | 42   | 0.0626          |
| 0.0522        | 1.8462 | 48   | 0.0465          |
| 0.033         | 2.0769 | 54   | 0.0282          |
| 0.0333        | 2.3077 | 60   | 0.0225          |
| 0.0171        | 2.5385 | 66   | 0.0203          |
| 0.0172        | 2.7692 | 72   | 0.0144          |
| 0.0095        | 3.0    | 78   | 0.0119          |
| 0.0088        | 3.2308 | 84   | 0.0099          |
| 0.0054        | 3.4615 | 90   | 0.0089          |
| 0.0073        | 3.6923 | 96   | 0.0085          |
| 0.0059        | 3.9231 | 102  | 0.0077          |


### Framework versions

- PEFT 0.13.0
- Transformers 4.45.1
- Pytorch 2.3.1+cu121
- Datasets 2.21.0
- Tokenizers 0.20.0