chchen commited on
Commit
18b1374
1 Parent(s): c67029c

Model save

Browse files
.ipynb_checkpoints/lora_orpo-checkpoint.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: mistralai/Mistral-7B-Instruct-v0.2
3
+
4
+ ### method
5
+ stage: orpo
6
+ do_train: true
7
+ finetuning_type: lora
8
+ lora_target: all
9
+
10
+ ### dataset
11
+ dataset: dpo_mix_en
12
+ dataset_dir: data
13
+ template: mistral
14
+ cutoff_len: 1024
15
+ max_samples: 1000
16
+ overwrite_cache: true
17
+ preprocessing_num_workers: 16
18
+
19
+ ### output
20
+ output_dir: saves/Mistral-7B-Instruct-v0.2/lora/orpo
21
+ logging_steps: 10
22
+ save_steps: 500
23
+ plot_loss: true
24
+ overwrite_output_dir: true
25
+ save_total_limit: 3
26
+ load_best_model_at_end: true
27
+ push_to_hub: true
28
+ hub_model_id: chchen/Mistral-7B-Instruct-v0.2-ORPO
29
+
30
+ ### train
31
+ per_device_train_batch_size: 2
32
+ gradient_accumulation_steps: 8
33
+ learning_rate: 0.000005
34
+ num_train_epochs: 3.0
35
+ lr_scheduler_type: cosine
36
+ warmup_steps: 0.1
37
+ fp16: true
38
+
39
+ ### eval
40
+ val_size: 0.1
41
+ per_device_eval_batch_size: 4
42
+ evaluation_strategy: steps
43
+ eval_steps: 500
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: peft
4
+ tags:
5
+ - trl
6
+ - dpo
7
+ - llama-factory
8
+ - generated_from_trainer
9
+ base_model: mistralai/Mistral-7B-Instruct-v0.2
10
+ model-index:
11
+ - name: Mistral-7B-Instruct-v0.2-ORPO
12
+ results: []
13
+ ---
14
+
15
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
+ should probably proofread and complete it, then remove this comment. -->
17
+
18
+ # Mistral-7B-Instruct-v0.2-ORPO
19
+
20
+ This model is a fine-tuned version of [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) on an unknown dataset.
21
+
22
+ ## Model description
23
+
24
+ More information needed
25
+
26
+ ## Intended uses & limitations
27
+
28
+ More information needed
29
+
30
+ ## Training and evaluation data
31
+
32
+ More information needed
33
+
34
+ ## Training procedure
35
+
36
+ ### Training hyperparameters
37
+
38
+ The following hyperparameters were used during training:
39
+ - learning_rate: 5e-06
40
+ - train_batch_size: 2
41
+ - eval_batch_size: 4
42
+ - seed: 42
43
+ - gradient_accumulation_steps: 8
44
+ - total_train_batch_size: 16
45
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
46
+ - lr_scheduler_type: cosine
47
+ - lr_scheduler_warmup_steps: 0.1
48
+ - num_epochs: 3.0
49
+ - mixed_precision_training: Native AMP
50
+
51
+ ### Training results
52
+
53
+
54
+
55
+ ### Framework versions
56
+
57
+ - PEFT 0.10.0
58
+ - Transformers 4.40.1
59
+ - Pytorch 2.3.0
60
+ - Datasets 2.19.0
61
+ - Tokenizers 0.19.1
adapter_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "mistralai/Mistral-7B-Instruct-v0.2",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 16,
14
+ "lora_dropout": 0.0,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 8,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "o_proj",
24
+ "q_proj",
25
+ "k_proj",
26
+ "gate_proj",
27
+ "down_proj",
28
+ "v_proj",
29
+ "up_proj"
30
+ ],
31
+ "task_type": "CAUSAL_LM",
32
+ "use_dora": false,
33
+ "use_rslora": false
34
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47477a7d72be6c59779358b5d59abe1532ce5697e206c4db569081d50b392cac
3
+ size 83945296
lora_orpo.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: mistralai/Mistral-7B-Instruct-v0.2
3
+
4
+ ### method
5
+ stage: orpo
6
+ do_train: true
7
+ finetuning_type: lora
8
+ lora_target: all
9
+
10
+ ### dataset
11
+ dataset: dpo_mix_en
12
+ dataset_dir: data
13
+ template: mistral
14
+ cutoff_len: 1024
15
+ max_samples: 1000
16
+ overwrite_cache: true
17
+ preprocessing_num_workers: 16
18
+
19
+ ### output
20
+ output_dir: saves/Mistral-7B-Instruct-v0.2/lora/orpo
21
+ logging_steps: 10
22
+ save_steps: 500
23
+ plot_loss: true
24
+ overwrite_output_dir: true
25
+ save_total_limit: 3
26
+ load_best_model_at_end: true
27
+ push_to_hub: true
28
+ hub_model_id: chchen/Mistral-7B-Instruct-v0.2-ORPO
29
+
30
+ ### train
31
+ per_device_train_batch_size: 2
32
+ gradient_accumulation_steps: 8
33
+ learning_rate: 0.000005
34
+ num_train_epochs: 3.0
35
+ lr_scheduler_type: cosine
36
+ warmup_steps: 0.1
37
+ fp16: true
38
+
39
+ ### eval
40
+ val_size: 0.1
41
+ per_device_eval_batch_size: 4
42
+ evaluation_strategy: steps
43
+ eval_steps: 500
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.json ADDED
The diff for this file is too large to render. See raw diff
 
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
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ }
29
+ },
30
+ "additional_special_tokens": [],
31
+ "bos_token": "<s>",
32
+ "chat_template": "{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{{ '<s>' + system_message }}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ ' [INST] ' + content + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ content + '</s>' }}{% endif %}{% endfor %}",
33
+ "clean_up_tokenization_spaces": false,
34
+ "eos_token": "</s>",
35
+ "legacy": true,
36
+ "model_max_length": 1000000000000000019884624838656,
37
+ "pad_token": "</s>",
38
+ "padding_side": "right",
39
+ "sp_model_kwargs": {},
40
+ "spaces_between_special_tokens": false,
41
+ "split_special_tokens": false,
42
+ "tokenizer_class": "LlamaTokenizer",
43
+ "unk_token": "<unk>",
44
+ "use_default_system_prompt": false
45
+ }
trainer_log.jsonl ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"current_steps": 10, "total_steps": 168, "loss": 1.3004, "accuracy": 0.45625001192092896, "learning_rate": 4.957230266673969e-06, "epoch": 0.17777777777777778, "percentage": 5.95, "elapsed_time": "0:05:27", "remaining_time": "1:26:19"}
2
+ {"current_steps": 20, "total_steps": 168, "loss": 1.1815, "accuracy": 0.48124998807907104, "learning_rate": 4.84529614391025e-06, "epoch": 0.35555555555555557, "percentage": 11.9, "elapsed_time": "0:10:47", "remaining_time": "1:19:52"}
3
+ {"current_steps": 30, "total_steps": 168, "loss": 1.2768, "accuracy": 0.4375, "learning_rate": 4.667009949002349e-06, "epoch": 0.5333333333333333, "percentage": 17.86, "elapsed_time": "0:16:08", "remaining_time": "1:14:14"}
4
+ {"current_steps": 40, "total_steps": 168, "loss": 1.2213, "accuracy": 0.48124998807907104, "learning_rate": 4.397288409237892e-06, "epoch": 0.7111111111111111, "percentage": 23.81, "elapsed_time": "0:21:22", "remaining_time": "1:08:22"}
5
+ {"current_steps": 50, "total_steps": 168, "loss": 1.3385, "accuracy": 0.48124998807907104, "learning_rate": 4.097593272948218e-06, "epoch": 0.8888888888888888, "percentage": 29.76, "elapsed_time": "0:26:40", "remaining_time": "1:02:56"}
6
+ {"current_steps": 60, "total_steps": 168, "loss": 1.1266, "accuracy": 0.550000011920929, "learning_rate": 3.712001321256744e-06, "epoch": 1.0666666666666667, "percentage": 35.71, "elapsed_time": "0:31:51", "remaining_time": "0:57:20"}
7
+ {"current_steps": 70, "total_steps": 168, "loss": 1.1365, "accuracy": 0.512499988079071, "learning_rate": 3.284100248421622e-06, "epoch": 1.2444444444444445, "percentage": 41.67, "elapsed_time": "0:37:11", "remaining_time": "0:52:03"}
8
+ {"current_steps": 80, "total_steps": 168, "loss": 1.1088, "accuracy": 0.4749999940395355, "learning_rate": 2.8288274295187397e-06, "epoch": 1.4222222222222223, "percentage": 47.62, "elapsed_time": "0:42:29", "remaining_time": "0:46:43"}
9
+ {"current_steps": 90, "total_steps": 168, "loss": 1.1411, "accuracy": 0.512499988079071, "learning_rate": 2.3620757456122797e-06, "epoch": 1.6, "percentage": 53.57, "elapsed_time": "0:47:40", "remaining_time": "0:41:18"}
10
+ {"current_steps": 100, "total_steps": 168, "loss": 1.1326, "accuracy": 0.5625, "learning_rate": 1.9001387874698865e-06, "epoch": 1.7777777777777777, "percentage": 59.52, "elapsed_time": "0:53:01", "remaining_time": "0:36:03"}
11
+ {"current_steps": 110, "total_steps": 168, "loss": 1.1523, "accuracy": 0.4937500059604645, "learning_rate": 1.4591420711120425e-06, "epoch": 1.9555555555555557, "percentage": 65.48, "elapsed_time": "0:58:17", "remaining_time": "0:30:44"}
12
+ {"current_steps": 120, "total_steps": 168, "loss": 1.1173, "accuracy": 0.48750001192092896, "learning_rate": 1.0544801205950327e-06, "epoch": 2.1333333333333333, "percentage": 71.43, "elapsed_time": "1:03:36", "remaining_time": "0:25:26"}
13
+ {"current_steps": 130, "total_steps": 168, "loss": 1.0107, "accuracy": 0.48750001192092896, "learning_rate": 7.002790686106056e-07, "epoch": 2.311111111111111, "percentage": 77.38, "elapsed_time": "1:08:55", "remaining_time": "0:20:08"}
14
+ {"current_steps": 140, "total_steps": 168, "loss": 1.1034, "accuracy": 0.6000000238418579, "learning_rate": 4.0890353469735717e-07, "epoch": 2.488888888888889, "percentage": 83.33, "elapsed_time": "1:14:09", "remaining_time": "0:14:49"}
15
+ {"current_steps": 150, "total_steps": 168, "loss": 1.2074, "accuracy": 0.48124998807907104, "learning_rate": 1.905249951948071e-07, "epoch": 2.6666666666666665, "percentage": 89.29, "elapsed_time": "1:19:35", "remaining_time": "0:09:33"}
16
+ {"current_steps": 160, "total_steps": 168, "loss": 1.0456, "accuracy": 0.581250011920929, "learning_rate": 5.2766712488021566e-08, "epoch": 2.8444444444444446, "percentage": 95.24, "elapsed_time": "1:24:53", "remaining_time": "0:04:14"}
17
+ {"current_steps": 168, "total_steps": 168, "epoch": 2.986666666666667, "percentage": 100.0, "elapsed_time": "1:29:12", "remaining_time": "0:00:00"}
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e875a0588d918bab72083c41753731da8efab74b78ea8d8dc9bfa65b5b65635
3
+ size 5240