Jue Wang commited on
Commit
cb70b64
·
1 Parent(s): d25ba68
README.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: peft
4
+ tags:
5
+ - axolotl
6
+ - generated_from_trainer
7
+ base_model: mistralai/Mixtral-8x7B-Instruct-v0.1
8
+ model-index:
9
+ - name: mixtral-lora-less-modules
10
+ results: []
11
+ ---
12
+
13
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
14
+ should probably proofread and complete it, then remove this comment. -->
15
+
16
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
17
+ <details><summary>See axolotl config</summary>
18
+
19
+ axolotl version: `0.4.0`
20
+ ```yaml
21
+ base_model: mistralai/Mixtral-8x7B-Instruct-v0.1
22
+ model_type: AutoModelForCausalLM
23
+ tokenizer_type: LlamaTokenizer
24
+ is_mistral_derived_model: true
25
+ load_in_8bit: false
26
+ load_in_4bit: true
27
+ strict: false
28
+ chat_template: inst
29
+
30
+ datasets:
31
+ - path: ./data/raw_format/tool_used_training.jsonl
32
+ type: sharegpt
33
+ conversation: mistral
34
+ - path: ./data/raw_format/tool_not_used_training.jsonl
35
+ type: sharegpt
36
+ conversation: mistral
37
+ - path: ./data/raw_format/no_tools_training.jsonl
38
+ type: sharegpt
39
+ conversation: mistral
40
+
41
+ dataset_prepared_path: last_run_prepared
42
+ val_set_size: 0.01
43
+ output_dir: ./mixtral-lora-2-epochs-r64
44
+
45
+ adapter: qlora
46
+ lora_model_dir:
47
+
48
+ sequence_len: 4096
49
+ sample_packing: true
50
+ pad_to_sequence_len: true
51
+
52
+ lora_r: 64
53
+ lora_alpha: 64
54
+ lora_dropout: 0.05
55
+ lora_fan_in_fan_out:
56
+ hub_model_id: liuylhf/mixtral-lora-less-modules
57
+ hub_strategy: end
58
+
59
+ lora_target_modules:
60
+ - q_proj
61
+ - v_proj
62
+ - k_proj
63
+ - o_proj
64
+
65
+ wandb_project: function-call
66
+ wandb_name: mixtral-instruct-raw-data-v3
67
+ wandb_log_model: end
68
+
69
+ gradient_accumulation_steps: 4
70
+ micro_batch_size: 2
71
+ num_epochs: 4
72
+ optimizer: paged_adamw_8bit
73
+ lr_scheduler: cosine
74
+ learning_rate: 0.001
75
+ adam_beta2: 0.95
76
+ adam_epsilon: 0.00001
77
+ max_grad_norm: 1.0
78
+
79
+ train_on_inputs: false
80
+ group_by_length: false
81
+ bf16: auto
82
+ fp16:
83
+ tf32: false
84
+
85
+ gradient_checkpointing: true
86
+ early_stopping_patience:
87
+ resume_from_checkpoint:
88
+ local_rank:
89
+ logging_steps: 1
90
+ xformers_attention:
91
+ flash_attention: true
92
+
93
+ # loss_watchdog_threshold: 5.0
94
+ # loss_watchdog_patience: 3
95
+
96
+ warmup_steps: 10
97
+ # evals_per_epoch: 20
98
+ eval_steps: 0.1
99
+ save_steps: 0.1
100
+ eval_table_size:
101
+ eval_max_new_tokens: 256
102
+ # saves_per_epoch: 1
103
+ debug:
104
+ deepspeed:
105
+ weight_decay: 1.0
106
+ fsdp:
107
+ fsdp_config:
108
+ ```
109
+
110
+ </details><br>
111
+
112
+ # mixtral-lora-less-modules
113
+
114
+ This model is a fine-tuned version of [mistralai/Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) on the None dataset.
115
+ It achieves the following results on the evaluation set:
116
+ - Loss: 0.1904
117
+
118
+ ## Model description
119
+
120
+ More information needed
121
+
122
+ ## Intended uses & limitations
123
+
124
+ More information needed
125
+
126
+ ## Training and evaluation data
127
+
128
+ More information needed
129
+
130
+ ## Training procedure
131
+
132
+ ### Training hyperparameters
133
+
134
+ The following hyperparameters were used during training:
135
+ - learning_rate: 0.001
136
+ - train_batch_size: 2
137
+ - eval_batch_size: 2
138
+ - seed: 42
139
+ - distributed_type: multi-GPU
140
+ - num_devices: 2
141
+ - gradient_accumulation_steps: 4
142
+ - total_train_batch_size: 16
143
+ - total_eval_batch_size: 4
144
+ - optimizer: Adam with betas=(0.9,0.95) and epsilon=1e-05
145
+ - lr_scheduler_type: cosine
146
+ - lr_scheduler_warmup_steps: 10
147
+ - num_epochs: 4
148
+
149
+ ### Training results
150
+
151
+ | Training Loss | Epoch | Step | Validation Loss |
152
+ |:-------------:|:-----:|:----:|:---------------:|
153
+ | 3.2966 | 0.0 | 1 | 3.2222 |
154
+ | 0.1826 | 0.4 | 123 | 0.2012 |
155
+ | 0.1729 | 0.8 | 246 | 0.1925 |
156
+ | 0.1852 | 1.19 | 369 | 0.1913 |
157
+ | 0.1463 | 1.59 | 492 | 0.1857 |
158
+ | 0.1246 | 1.99 | 615 | 0.1840 |
159
+ | 0.1149 | 2.37 | 738 | 0.1872 |
160
+ | 0.076 | 2.77 | 861 | 0.1837 |
161
+ | 0.0763 | 3.15 | 984 | 0.1920 |
162
+ | 0.0906 | 3.56 | 1107 | 0.1904 |
163
+
164
+
165
+ ### Framework versions
166
+
167
+ - PEFT 0.8.2
168
+ - Transformers 4.39.0.dev0
169
+ - Pytorch 2.2.0+cu121
170
+ - Datasets 2.17.1
171
+ - Tokenizers 0.15.0
adapter_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "mistralai/Mixtral-8x7B-Instruct-v0.1",
5
+ "bias": "none",
6
+ "fan_in_fan_out": null,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "loftq_config": {},
12
+ "lora_alpha": 64,
13
+ "lora_dropout": 0.05,
14
+ "megatron_config": null,
15
+ "megatron_core": "megatron.core",
16
+ "modules_to_save": null,
17
+ "peft_type": "LORA",
18
+ "r": 64,
19
+ "rank_pattern": {},
20
+ "revision": null,
21
+ "target_modules": [
22
+ "v_proj",
23
+ "k_proj",
24
+ "q_proj",
25
+ "o_proj"
26
+ ],
27
+ "task_type": "CAUSAL_LM",
28
+ "use_rslora": false
29
+ }
adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b736f258bbb6518c5c6320e3be740ea54cf01ad2bc94e6b90be1ee7c5199315
3
+ size 218196746
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bd14376b2f68b0c33a669ad954dd4a0f21b6ff2c5861b9ffc7865fdf6749503
3
+ size 218138576
config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "mistralai/Mixtral-8x7B-Instruct-v0.1",
3
+ "architectures": [
4
+ "MixtralForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 4096,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 14336,
13
+ "max_position_embeddings": 32768,
14
+ "model_type": "mixtral",
15
+ "num_attention_heads": 32,
16
+ "num_experts_per_tok": 2,
17
+ "num_hidden_layers": 32,
18
+ "num_key_value_heads": 8,
19
+ "num_local_experts": 8,
20
+ "output_router_logits": false,
21
+ "quantization_config": {
22
+ "_load_in_4bit": true,
23
+ "_load_in_8bit": false,
24
+ "bnb_4bit_compute_dtype": "bfloat16",
25
+ "bnb_4bit_quant_type": "nf4",
26
+ "bnb_4bit_use_double_quant": true,
27
+ "llm_int8_enable_fp32_cpu_offload": false,
28
+ "llm_int8_has_fp16_weight": false,
29
+ "llm_int8_skip_modules": null,
30
+ "llm_int8_threshold": 6.0,
31
+ "load_in_4bit": true,
32
+ "load_in_8bit": false,
33
+ "quant_method": "bitsandbytes"
34
+ },
35
+ "rms_norm_eps": 1e-05,
36
+ "rope_theta": 1000000.0,
37
+ "router_aux_loss_coef": 0.02,
38
+ "sliding_window": null,
39
+ "tie_word_embeddings": false,
40
+ "torch_dtype": "bfloat16",
41
+ "transformers_version": "4.39.0.dev0",
42
+ "use_cache": false,
43
+ "vocab_size": 32000
44
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "</s>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": true,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "additional_special_tokens": [],
32
+ "bos_token": "<s>",
33
+ "chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}",
34
+ "clean_up_tokenization_spaces": false,
35
+ "eos_token": "</s>",
36
+ "legacy": true,
37
+ "model_max_length": 1000000000000000019884624838656,
38
+ "pad_token": "</s>",
39
+ "sp_model_kwargs": {},
40
+ "spaces_between_special_tokens": false,
41
+ "tokenizer_class": "LlamaTokenizer",
42
+ "unk_token": "<unk>",
43
+ "use_default_system_prompt": false,
44
+ "use_fast": true
45
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e7d1c82c017295bf67e72f2f9c3276671b5c7c5e56727f36146b9af4b7bc72e
3
+ size 5624