inflaton commited on
Commit
43b88d5
·
1 Parent(s): f1e8d7b

l40 p2 completed 6 epochs

Browse files
Files changed (47) hide show
  1. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/README.md +72 -0
  2. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/adapter_config.json +32 -0
  3. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/adapter_model.safetensors +3 -0
  4. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/all_results.json +13 -0
  5. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/README.md +202 -0
  6. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/adapter_config.json +32 -0
  7. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/adapter_model.safetensors +3 -0
  8. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/optimizer.pt +3 -0
  9. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/rng_state.pth +3 -0
  10. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/scheduler.pt +3 -0
  11. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/special_tokens_map.json +38 -0
  12. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenization_internlm2.py +236 -0
  13. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenization_internlm2_fast.py +214 -0
  14. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenizer.json +0 -0
  15. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenizer.model +3 -0
  16. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenizer_config.json +104 -0
  17. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/trainer_state.json +386 -0
  18. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/training_args.bin +3 -0
  19. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/README.md +202 -0
  20. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/adapter_config.json +32 -0
  21. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/adapter_model.safetensors +3 -0
  22. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/optimizer.pt +3 -0
  23. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/rng_state.pth +3 -0
  24. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/scheduler.pt +3 -0
  25. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/special_tokens_map.json +38 -0
  26. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenization_internlm2.py +236 -0
  27. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenization_internlm2_fast.py +214 -0
  28. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenizer.json +0 -0
  29. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenizer.model +3 -0
  30. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenizer_config.json +104 -0
  31. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/trainer_state.json +451 -0
  32. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/training_args.bin +3 -0
  33. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/eval_results.json +8 -0
  34. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/special_tokens_map.json +38 -0
  35. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenization_internlm2.py +236 -0
  36. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenization_internlm2_fast.py +214 -0
  37. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenizer.json +0 -0
  38. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenizer.model +3 -0
  39. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenizer_config.json +104 -0
  40. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/train_results.json +8 -0
  41. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/trainer_log.jsonl +18 -0
  42. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/trainer_state.json +460 -0
  43. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_args.bin +3 -0
  44. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_eval_accuracy.png +0 -0
  45. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_eval_loss.png +0 -0
  46. llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_loss.png +0 -0
  47. results/l40_p2.txt +0 -0
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ library_name: peft
4
+ tags:
5
+ - llama-factory
6
+ - lora
7
+ - generated_from_trainer
8
+ base_model: internlm/internlm2_5-7b-chat-1m
9
+ metrics:
10
+ - accuracy
11
+ model-index:
12
+ - name: sft_bf16_p2_full
13
+ results: []
14
+ ---
15
+
16
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
17
+ should probably proofread and complete it, then remove this comment. -->
18
+
19
+ # sft_bf16_p2_full
20
+
21
+ This model is a fine-tuned version of [internlm/internlm2_5-7b-chat-1m](https://huggingface.co/internlm/internlm2_5-7b-chat-1m) on the alpaca_mgtv_p2 dataset.
22
+ It achieves the following results on the evaluation set:
23
+ - Loss: 0.4369
24
+ - Accuracy: 0.8984
25
+
26
+ ## Model description
27
+
28
+ More information needed
29
+
30
+ ## Intended uses & limitations
31
+
32
+ More information needed
33
+
34
+ ## Training and evaluation data
35
+
36
+ More information needed
37
+
38
+ ## Training procedure
39
+
40
+ ### Training hyperparameters
41
+
42
+ The following hyperparameters were used during training:
43
+ - learning_rate: 0.0001
44
+ - train_batch_size: 32
45
+ - eval_batch_size: 1
46
+ - seed: 42
47
+ - gradient_accumulation_steps: 8
48
+ - total_train_batch_size: 256
49
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
50
+ - lr_scheduler_type: cosine
51
+ - lr_scheduler_warmup_ratio: 0.1
52
+ - num_epochs: 6.0
53
+
54
+ ### Training results
55
+
56
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
57
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|
58
+ | 0.277 | 1.0 | 88 | 0.2600 | 0.9031 |
59
+ | 0.2427 | 2.0 | 176 | 0.2574 | 0.9006 |
60
+ | 0.1813 | 3.0 | 264 | 0.2706 | 0.9027 |
61
+ | 0.1263 | 4.0 | 352 | 0.2946 | 0.8994 |
62
+ | 0.0684 | 5.0 | 440 | 0.3700 | 0.8997 |
63
+ | 0.0486 | 6.0 | 528 | 0.4369 | 0.8984 |
64
+
65
+
66
+ ### Framework versions
67
+
68
+ - PEFT 0.11.1
69
+ - Transformers 4.41.2
70
+ - Pytorch 2.2.1+cu121
71
+ - Datasets 2.19.1
72
+ - Tokenizers 0.19.1
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/adapter_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "internlm/internlm2_5-7b-chat-1m",
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
+ "wqkv",
24
+ "w2",
25
+ "w1",
26
+ "w3",
27
+ "wo"
28
+ ],
29
+ "task_type": "CAUSAL_LM",
30
+ "use_dora": false,
31
+ "use_rslora": false
32
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92a2e3824954685b0ea8fb8a04cc2b4db2cfebb48037425fd844501b0c301050
3
+ size 75539712
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/all_results.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 6.0,
3
+ "eval_accuracy": 0.8984,
4
+ "eval_loss": 0.4368518590927124,
5
+ "eval_runtime": 232.12,
6
+ "eval_samples_per_second": 10.77,
7
+ "eval_steps_per_second": 10.77,
8
+ "total_flos": 2.9041541335076045e+18,
9
+ "train_loss": 0.28717788867652416,
10
+ "train_runtime": 47077.7992,
11
+ "train_samples_per_second": 2.868,
12
+ "train_steps_per_second": 0.011
13
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: internlm/internlm2_5-7b-chat-1m
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.11.1
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/adapter_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "internlm/internlm2_5-7b-chat-1m",
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
+ "wqkv",
24
+ "w2",
25
+ "w1",
26
+ "w3",
27
+ "wo"
28
+ ],
29
+ "task_type": "CAUSAL_LM",
30
+ "use_dora": false,
31
+ "use_rslora": false
32
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:628a2f898fdb7dab1660bfaa12309eff585e40d4c692fffe6795adc705dcea80
3
+ size 75539712
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fda0cb1eed9e9d314b3d0f546b49de8616dcb126afb643e9cb8f07e3a0df7ad
3
+ size 151264058
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d245e05e72192c132e0f2edb6fdcae0c578c890f0fe912f17ec7b0bba2d38cc3
3
+ size 14244
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbca99b341582421991e0d53c661a42ff44b04d0e45e04965ef5d464774e7259
3
+ size 1064
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/special_tokens_map.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|action_start|>",
6
+ "<|action_end|>",
7
+ "<|interpreter|>",
8
+ "<|plugin|>"
9
+ ],
10
+ "bos_token": {
11
+ "content": "<s>",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ },
17
+ "eos_token": {
18
+ "content": "</s>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": {
25
+ "content": "</s>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ },
31
+ "unk_token": {
32
+ "content": "<unk>",
33
+ "lstrip": false,
34
+ "normalized": false,
35
+ "rstrip": false,
36
+ "single_word": false
37
+ }
38
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenization_internlm2.py ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on transformers/src/transformers/models/llama/tokenization_llama.py
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tokenization classes for InternLM."""
19
+ import os
20
+ from shutil import copyfile
21
+ from typing import Any, Dict, List, Optional, Tuple
22
+
23
+ import sentencepiece as spm
24
+ from transformers.tokenization_utils import PreTrainedTokenizer
25
+ from transformers.utils import logging
26
+
27
+ logger = logging.get_logger(__name__)
28
+
29
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
30
+
31
+ PRETRAINED_VOCAB_FILES_MAP = {}
32
+
33
+
34
+ # Modified from transformers.model.llama.tokenization_llama.LlamaTokenizer
35
+ class InternLM2Tokenizer(PreTrainedTokenizer):
36
+ """
37
+ Construct a InternLM2 tokenizer. Based on byte-level Byte-Pair-Encoding.
38
+
39
+ Args:
40
+ vocab_file (`str`):
41
+ Path to the vocabulary file.
42
+ """
43
+
44
+ vocab_files_names = VOCAB_FILES_NAMES
45
+ pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
46
+ model_input_names = ["input_ids", "attention_mask"]
47
+ _auto_class = "AutoTokenizer"
48
+
49
+ def __init__(
50
+ self,
51
+ vocab_file,
52
+ unk_token="<unk>",
53
+ bos_token="<s>",
54
+ eos_token="</s>",
55
+ pad_token="</s>",
56
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
57
+ add_bos_token=True,
58
+ add_eos_token=False,
59
+ decode_with_prefix_space=False,
60
+ clean_up_tokenization_spaces=False,
61
+ **kwargs,
62
+ ):
63
+ self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
64
+ self.vocab_file = vocab_file
65
+ self.add_bos_token = add_bos_token
66
+ self.add_eos_token = add_eos_token
67
+ self.decode_with_prefix_space = decode_with_prefix_space
68
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
69
+ self.sp_model.Load(vocab_file)
70
+ self._no_prefix_space_tokens = None
71
+ super().__init__(
72
+ bos_token=bos_token,
73
+ eos_token=eos_token,
74
+ unk_token=unk_token,
75
+ pad_token=pad_token,
76
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
77
+ **kwargs,
78
+ )
79
+
80
+ @property
81
+ def no_prefix_space_tokens(self):
82
+ if self._no_prefix_space_tokens is None:
83
+ vocab = self.convert_ids_to_tokens(list(range(self.vocab_size)))
84
+ self._no_prefix_space_tokens = {i for i, tok in enumerate(vocab) if not tok.startswith("▁")}
85
+ return self._no_prefix_space_tokens
86
+
87
+ @property
88
+ def vocab_size(self):
89
+ """Returns vocab size"""
90
+ return self.sp_model.get_piece_size()
91
+
92
+ @property
93
+ def bos_token_id(self) -> Optional[int]:
94
+ return self.sp_model.bos_id()
95
+
96
+ @property
97
+ def eos_token_id(self) -> Optional[int]:
98
+ return self.sp_model.eos_id()
99
+
100
+ def get_vocab(self):
101
+ """Returns vocab as a dict"""
102
+ vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
103
+ vocab.update(self.added_tokens_encoder)
104
+ return vocab
105
+
106
+ def _tokenize(self, text):
107
+ """Returns a tokenized string."""
108
+ return self.sp_model.encode(text, out_type=str)
109
+
110
+ def _convert_token_to_id(self, token):
111
+ """Converts a token (str) in an id using the vocab."""
112
+ return self.sp_model.piece_to_id(token)
113
+
114
+ def _convert_id_to_token(self, index):
115
+ """Converts an index (integer) in a token (str) using the vocab."""
116
+ token = self.sp_model.IdToPiece(index)
117
+ return token
118
+
119
+ def _maybe_add_prefix_space(self, tokens, decoded):
120
+ if tokens and tokens[0] not in self.no_prefix_space_tokens:
121
+ return " " + decoded
122
+ else:
123
+ return decoded
124
+
125
+ def convert_tokens_to_string(self, tokens):
126
+ """Converts a sequence of tokens (string) in a single string."""
127
+ current_sub_tokens = []
128
+ out_string = ""
129
+ prev_is_special = False
130
+ for token in tokens:
131
+ # make sure that special tokens are not decoded using sentencepiece model
132
+ if token in self.all_special_tokens:
133
+ if not prev_is_special:
134
+ out_string += " "
135
+ out_string += self.sp_model.decode(current_sub_tokens) + token
136
+ prev_is_special = True
137
+ current_sub_tokens = []
138
+ else:
139
+ current_sub_tokens.append(token)
140
+ prev_is_special = False
141
+ out_string += self.sp_model.decode(current_sub_tokens)
142
+ out_string = self.clean_up_tokenization(out_string)
143
+ out_string = self._maybe_add_prefix_space(tokens=tokens, decoded=out_string)
144
+ return out_string[1:]
145
+
146
+ def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
147
+ """
148
+ Save the vocabulary and special tokens file to a directory.
149
+
150
+ Args:
151
+ save_directory (`str`):
152
+ The directory in which to save the vocabulary.
153
+
154
+ Returns:
155
+ `Tuple(str)`: Paths to the files saved.
156
+ """
157
+ if not os.path.isdir(save_directory):
158
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
159
+ return
160
+ out_vocab_file = os.path.join(
161
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
162
+ )
163
+
164
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
165
+ copyfile(self.vocab_file, out_vocab_file)
166
+ elif not os.path.isfile(self.vocab_file):
167
+ with open(out_vocab_file, "wb") as fi:
168
+ content_spiece_model = self.sp_model.serialized_model_proto()
169
+ fi.write(content_spiece_model)
170
+
171
+ return (out_vocab_file,)
172
+
173
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
174
+ if self.add_bos_token:
175
+ bos_token_ids = [self.bos_token_id]
176
+ else:
177
+ bos_token_ids = []
178
+
179
+ output = bos_token_ids + token_ids_0
180
+
181
+ if token_ids_1 is not None:
182
+ output = output + token_ids_1
183
+
184
+ if self.add_eos_token:
185
+ output = output + [self.eos_token_id]
186
+
187
+ return output
188
+
189
+ def get_special_tokens_mask(
190
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
191
+ ) -> List[int]:
192
+ """
193
+ Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
194
+ special tokens using the tokenizer `prepare_for_model` method.
195
+
196
+ Args:
197
+ token_ids_0 (`List[int]`):
198
+ List of IDs.
199
+ token_ids_1 (`List[int]`, *optional*):
200
+ Optional second list of IDs for sequence pairs.
201
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
202
+ Whether or not the token list is already formatted with special tokens for the model.
203
+
204
+ Returns:
205
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
206
+ """
207
+ if already_has_special_tokens:
208
+ return super().get_special_tokens_mask(
209
+ token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
210
+ )
211
+
212
+ if token_ids_1 is None:
213
+ return [1] + ([0] * len(token_ids_0)) + [1]
214
+ return [1] + ([0] * len(token_ids_0)) + [1, 1] + ([0] * len(token_ids_1)) + [1]
215
+
216
+ def create_token_type_ids_from_sequences(
217
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
218
+ ) -> List[int]:
219
+ """
220
+ Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
221
+ use of token type ids, therefore a list of zeros is returned.
222
+
223
+ Args:
224
+ token_ids_0 (`List[int]`):
225
+ List of IDs.
226
+ token_ids_1 (`List[int]`, *optional*):
227
+ Optional second list of IDs for sequence pairs.
228
+
229
+ Returns:
230
+ `List[int]`: List of zeros.
231
+ """
232
+ eos = [self.eos_token_id]
233
+
234
+ if token_ids_1 is None:
235
+ return len(token_ids_0 + eos) * [0]
236
+ return len(token_ids_0 + eos + token_ids_1 + eos) * [0]
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenization_internlm2_fast.py ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on transformers/src/transformers/models/llama/tokenization_llama_fast.py
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tokenization Fast class for InternLM."""
19
+ import os
20
+ from shutil import copyfile
21
+ from typing import Any, Dict, Optional, Tuple
22
+
23
+ from tokenizers import processors, decoders, Tokenizer, normalizers
24
+ from tokenizers.models import BPE
25
+
26
+ from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
27
+ from transformers.utils import logging
28
+
29
+ from transformers.convert_slow_tokenizer import (
30
+ SLOW_TO_FAST_CONVERTERS,
31
+ SpmConverter,
32
+ SentencePieceExtractor,
33
+ )
34
+
35
+ from .tokenization_internlm2 import InternLM2Tokenizer
36
+
37
+ logger = logging.get_logger(__name__)
38
+
39
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
40
+
41
+ # Modified from transformers.convert_slow_tokenizer.LlamaConverter
42
+ class InternLM2Converter(SpmConverter):
43
+ handle_byte_fallback = True
44
+
45
+ def vocab(self, proto):
46
+ vocab = [
47
+ ("<unk>", 0.0),
48
+ ("<s>", 0.0),
49
+ ("</s>", 0.0),
50
+ ]
51
+ vocab += [(piece.piece, piece.score) for piece in proto.pieces[3:]]
52
+ return vocab
53
+
54
+ def unk_id(self, proto):
55
+ unk_id = 0
56
+ return unk_id
57
+
58
+ def decoder(self, replacement, add_prefix_space):
59
+ decoders_sequence = [
60
+ decoders.Replace("▁", " "),
61
+ decoders.ByteFallback(),
62
+ decoders.Fuse(),
63
+ ]
64
+ if self.proto.normalizer_spec.add_dummy_prefix:
65
+ decoders_sequence.append(decoders.Strip(content=" ", left=1))
66
+ return decoders.Sequence(decoders_sequence)
67
+
68
+ def tokenizer(self, proto):
69
+ model_type = proto.trainer_spec.model_type
70
+ vocab_scores = self.vocab(proto)
71
+ # special tokens
72
+ added_tokens = self.original_tokenizer.added_tokens_decoder
73
+ for i in range(len(vocab_scores)):
74
+ piece, score = vocab_scores[i]
75
+ if i in added_tokens:
76
+ vocab_scores[i] = (added_tokens[i].content, score)
77
+ if model_type == 1:
78
+ raise RuntimeError("InternLM2 is supposed to be a BPE model!")
79
+
80
+ elif model_type == 2:
81
+ _, merges = SentencePieceExtractor(self.original_tokenizer.vocab_file).extract(vocab_scores)
82
+ bpe_vocab = {word: i for i, (word, _score) in enumerate(vocab_scores)}
83
+ tokenizer = Tokenizer(
84
+ BPE(bpe_vocab, merges, unk_token=proto.trainer_spec.unk_piece, fuse_unk=True, byte_fallback=True)
85
+ )
86
+ tokenizer.add_special_tokens(
87
+ [ added_token for index, added_token in added_tokens.items()]
88
+ )
89
+ else:
90
+ raise Exception(
91
+ "You're trying to run a `Unigram` model but you're file was trained with a different algorithm"
92
+ )
93
+
94
+ return tokenizer
95
+
96
+ def normalizer(self, proto):
97
+ normalizers_list = []
98
+ if proto.normalizer_spec.add_dummy_prefix:
99
+ normalizers_list.append(normalizers.Prepend(prepend="▁"))
100
+ normalizers_list.append(normalizers.Replace(pattern=" ", content="▁"))
101
+ return normalizers.Sequence(normalizers_list)
102
+
103
+ def pre_tokenizer(self, replacement, add_prefix_space):
104
+ return None
105
+
106
+ SLOW_TO_FAST_CONVERTERS["InternLM2Tokenizer"] = InternLM2Converter
107
+
108
+
109
+ # Modified from transformers.model.llama.tokenization_llama_fast.LlamaTokenizerFast -> InternLM2TokenizerFast
110
+ class InternLM2TokenizerFast(PreTrainedTokenizerFast):
111
+ vocab_files_names = VOCAB_FILES_NAMES
112
+ slow_tokenizer_class = InternLM2Tokenizer
113
+ padding_side = "left"
114
+ model_input_names = ["input_ids", "attention_mask"]
115
+ _auto_class = "AutoTokenizer"
116
+
117
+ def __init__(
118
+ self,
119
+ vocab_file,
120
+ unk_token="<unk>",
121
+ bos_token="<s>",
122
+ eos_token="</s>",
123
+ pad_token="</s>",
124
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
125
+ add_bos_token=True,
126
+ add_eos_token=False,
127
+ decode_with_prefix_space=False,
128
+ clean_up_tokenization_spaces=False,
129
+ **kwargs,
130
+ ):
131
+ super().__init__(
132
+ vocab_file=vocab_file,
133
+ unk_token=unk_token,
134
+ bos_token=bos_token,
135
+ eos_token=eos_token,
136
+ pad_token=pad_token,
137
+ sp_model_kwargs=sp_model_kwargs,
138
+ add_bos_token=add_bos_token,
139
+ add_eos_token=add_eos_token,
140
+ decode_with_prefix_space=decode_with_prefix_space,
141
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
142
+ **kwargs,
143
+ )
144
+ self._add_bos_token = add_bos_token
145
+ self._add_eos_token = add_eos_token
146
+ self.update_post_processor()
147
+ self.vocab_file = vocab_file
148
+
149
+ @property
150
+ def can_save_slow_tokenizer(self) -> bool:
151
+ return os.path.isfile(self.vocab_file) if self.vocab_file else False
152
+
153
+ def update_post_processor(self):
154
+ """
155
+ Updates the underlying post processor with the current `bos_token` and `eos_token`.
156
+ """
157
+ bos = self.bos_token
158
+ bos_token_id = self.bos_token_id
159
+ if bos is None and self.add_bos_token:
160
+ raise ValueError("add_bos_token = True but bos_token = None")
161
+
162
+ eos = self.eos_token
163
+ eos_token_id = self.eos_token_id
164
+ if eos is None and self.add_eos_token:
165
+ raise ValueError("add_eos_token = True but eos_token = None")
166
+
167
+ single = f"{(bos+':0 ') if self.add_bos_token else ''}$A:0{(' '+eos+':0') if self.add_eos_token else ''}"
168
+ pair = f"{single}{(' '+bos+':1') if self.add_bos_token else ''} $B:1{(' '+eos+':1') if self.add_eos_token else ''}"
169
+
170
+ special_tokens = []
171
+ if self.add_bos_token:
172
+ special_tokens.append((bos, bos_token_id))
173
+ if self.add_eos_token:
174
+ special_tokens.append((eos, eos_token_id))
175
+ self._tokenizer.post_processor = processors.TemplateProcessing(
176
+ single=single, pair=pair, special_tokens=special_tokens
177
+ )
178
+
179
+ @property
180
+ def add_eos_token(self):
181
+ return self._add_eos_token
182
+
183
+ @property
184
+ def add_bos_token(self):
185
+ return self._add_bos_token
186
+
187
+ @add_eos_token.setter
188
+ def add_eos_token(self, value):
189
+ self._add_eos_token = value
190
+ self.update_post_processor()
191
+
192
+ @add_bos_token.setter
193
+ def add_bos_token(self, value):
194
+ self._add_bos_token = value
195
+ self.update_post_processor()
196
+
197
+ def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
198
+ if not self.can_save_slow_tokenizer:
199
+ raise ValueError(
200
+ "Your fast tokenizer does not have the necessary information to save the vocabulary for a slow "
201
+ "tokenizer."
202
+ )
203
+
204
+ if not os.path.isdir(save_directory):
205
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
206
+ return
207
+ out_vocab_file = os.path.join(
208
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
209
+ )
210
+
211
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file):
212
+ copyfile(self.vocab_file, out_vocab_file)
213
+
214
+ return (out_vocab_file,)
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f868398fc4e05ee1e8aeba95ddf18ddcc45b8bce55d5093bead5bbf80429b48b
3
+ size 1477754
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/tokenizer_config.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "92538": {
30
+ "content": "<|plugin|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "92539": {
38
+ "content": "<|interpreter|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "92540": {
46
+ "content": "<|action_end|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "92541": {
54
+ "content": "<|action_start|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "92542": {
62
+ "content": "<|im_end|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "92543": {
70
+ "content": "<|im_start|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ }
77
+ },
78
+ "additional_special_tokens": [
79
+ "<|im_start|>",
80
+ "<|im_end|>",
81
+ "<|action_start|>",
82
+ "<|action_end|>",
83
+ "<|interpreter|>",
84
+ "<|plugin|>"
85
+ ],
86
+ "auto_map": {
87
+ "AutoTokenizer": [
88
+ "tokenization_internlm2.InternLM2Tokenizer",
89
+ "tokenization_internlm2_fast.InternLM2TokenizerFast"
90
+ ]
91
+ },
92
+ "bos_token": "<s>",
93
+ "chat_template": "{{ '<s>' }}{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + content + '<|im_end|>\n<|im_start|>assistant\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>\n' }}{% endif %}{% endfor %}",
94
+ "clean_up_tokenization_spaces": false,
95
+ "decode_with_prefix_space": false,
96
+ "eos_token": "</s>",
97
+ "model_max_length": 1000000000000000019884624838656,
98
+ "pad_token": "</s>",
99
+ "padding_side": "right",
100
+ "sp_model_kwargs": null,
101
+ "split_special_tokens": false,
102
+ "tokenizer_class": "InternLM2Tokenizer",
103
+ "unk_token": "<unk>"
104
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/trainer_state.json ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 5.0,
5
+ "eval_steps": 88,
6
+ "global_step": 440,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.11363636363636363,
13
+ "grad_norm": 3.514838457107544,
14
+ "learning_rate": 1.8867924528301888e-05,
15
+ "loss": 6.943,
16
+ "step": 10
17
+ },
18
+ {
19
+ "epoch": 0.22727272727272727,
20
+ "grad_norm": 1.0595427751541138,
21
+ "learning_rate": 3.7735849056603776e-05,
22
+ "loss": 0.446,
23
+ "step": 20
24
+ },
25
+ {
26
+ "epoch": 0.3409090909090909,
27
+ "grad_norm": 0.6256385445594788,
28
+ "learning_rate": 5.660377358490566e-05,
29
+ "loss": 0.3515,
30
+ "step": 30
31
+ },
32
+ {
33
+ "epoch": 0.45454545454545453,
34
+ "grad_norm": 0.633573055267334,
35
+ "learning_rate": 7.547169811320755e-05,
36
+ "loss": 0.288,
37
+ "step": 40
38
+ },
39
+ {
40
+ "epoch": 0.5681818181818182,
41
+ "grad_norm": 0.4915701746940613,
42
+ "learning_rate": 9.433962264150944e-05,
43
+ "loss": 0.2819,
44
+ "step": 50
45
+ },
46
+ {
47
+ "epoch": 0.6818181818181818,
48
+ "grad_norm": 0.40083640813827515,
49
+ "learning_rate": 9.994642390694308e-05,
50
+ "loss": 0.2765,
51
+ "step": 60
52
+ },
53
+ {
54
+ "epoch": 0.7954545454545454,
55
+ "grad_norm": 0.7176418304443359,
56
+ "learning_rate": 9.968428675226714e-05,
57
+ "loss": 0.2754,
58
+ "step": 70
59
+ },
60
+ {
61
+ "epoch": 0.9090909090909091,
62
+ "grad_norm": 0.6853049397468567,
63
+ "learning_rate": 9.92048928531717e-05,
64
+ "loss": 0.277,
65
+ "step": 80
66
+ },
67
+ {
68
+ "epoch": 1.0,
69
+ "eval_accuracy": 0.9030666666666668,
70
+ "eval_loss": 0.26003387570381165,
71
+ "eval_runtime": 231.9406,
72
+ "eval_samples_per_second": 10.779,
73
+ "eval_steps_per_second": 10.779,
74
+ "step": 88
75
+ },
76
+ {
77
+ "epoch": 1.0227272727272727,
78
+ "grad_norm": 0.4268323481082916,
79
+ "learning_rate": 9.851033847720166e-05,
80
+ "loss": 0.2619,
81
+ "step": 90
82
+ },
83
+ {
84
+ "epoch": 1.1363636363636362,
85
+ "grad_norm": 0.9503114819526672,
86
+ "learning_rate": 9.760366073392246e-05,
87
+ "loss": 0.2385,
88
+ "step": 100
89
+ },
90
+ {
91
+ "epoch": 1.25,
92
+ "grad_norm": 0.3606574237346649,
93
+ "learning_rate": 9.648882429441257e-05,
94
+ "loss": 0.2341,
95
+ "step": 110
96
+ },
97
+ {
98
+ "epoch": 1.3636363636363638,
99
+ "grad_norm": 0.7226484417915344,
100
+ "learning_rate": 9.517070405476575e-05,
101
+ "loss": 0.2447,
102
+ "step": 120
103
+ },
104
+ {
105
+ "epoch": 1.4772727272727273,
106
+ "grad_norm": 0.8543397188186646,
107
+ "learning_rate": 9.365506381941066e-05,
108
+ "loss": 0.2441,
109
+ "step": 130
110
+ },
111
+ {
112
+ "epoch": 1.5909090909090908,
113
+ "grad_norm": 0.800394594669342,
114
+ "learning_rate": 9.194853109746074e-05,
115
+ "loss": 0.2379,
116
+ "step": 140
117
+ },
118
+ {
119
+ "epoch": 1.7045454545454546,
120
+ "grad_norm": 0.5756838321685791,
121
+ "learning_rate": 9.005856812230304e-05,
122
+ "loss": 0.2434,
123
+ "step": 150
124
+ },
125
+ {
126
+ "epoch": 1.8181818181818183,
127
+ "grad_norm": 1.0771032571792603,
128
+ "learning_rate": 8.799343922115044e-05,
129
+ "loss": 0.2352,
130
+ "step": 160
131
+ },
132
+ {
133
+ "epoch": 1.9318181818181817,
134
+ "grad_norm": 0.4805872440338135,
135
+ "learning_rate": 8.576217467724128e-05,
136
+ "loss": 0.2427,
137
+ "step": 170
138
+ },
139
+ {
140
+ "epoch": 2.0,
141
+ "eval_accuracy": 0.9006,
142
+ "eval_loss": 0.25738978385925293,
143
+ "eval_runtime": 231.2131,
144
+ "eval_samples_per_second": 10.813,
145
+ "eval_steps_per_second": 10.813,
146
+ "step": 176
147
+ },
148
+ {
149
+ "epoch": 2.0454545454545454,
150
+ "grad_norm": 0.5219587683677673,
151
+ "learning_rate": 8.337453124270863e-05,
152
+ "loss": 0.22,
153
+ "step": 180
154
+ },
155
+ {
156
+ "epoch": 2.159090909090909,
157
+ "grad_norm": 0.6363154053688049,
158
+ "learning_rate": 8.084094947478556e-05,
159
+ "loss": 0.1787,
160
+ "step": 190
161
+ },
162
+ {
163
+ "epoch": 2.2727272727272725,
164
+ "grad_norm": 0.6807820796966553,
165
+ "learning_rate": 7.817250808190483e-05,
166
+ "loss": 0.1647,
167
+ "step": 200
168
+ },
169
+ {
170
+ "epoch": 2.3863636363636362,
171
+ "grad_norm": 0.5443515777587891,
172
+ "learning_rate": 7.538087547932585e-05,
173
+ "loss": 0.1828,
174
+ "step": 210
175
+ },
176
+ {
177
+ "epoch": 2.5,
178
+ "grad_norm": 0.4641902446746826,
179
+ "learning_rate": 7.247825876612353e-05,
180
+ "loss": 0.1782,
181
+ "step": 220
182
+ },
183
+ {
184
+ "epoch": 2.6136363636363638,
185
+ "grad_norm": 0.5865933299064636,
186
+ "learning_rate": 6.947735034665002e-05,
187
+ "loss": 0.1942,
188
+ "step": 230
189
+ },
190
+ {
191
+ "epoch": 2.7272727272727275,
192
+ "grad_norm": 0.5332173705101013,
193
+ "learning_rate": 6.639127242987988e-05,
194
+ "loss": 0.1852,
195
+ "step": 240
196
+ },
197
+ {
198
+ "epoch": 2.840909090909091,
199
+ "grad_norm": 0.5550218820571899,
200
+ "learning_rate": 6.323351964932908e-05,
201
+ "loss": 0.1936,
202
+ "step": 250
203
+ },
204
+ {
205
+ "epoch": 2.9545454545454546,
206
+ "grad_norm": 0.6850063800811768,
207
+ "learning_rate": 6.001790005445607e-05,
208
+ "loss": 0.1813,
209
+ "step": 260
210
+ },
211
+ {
212
+ "epoch": 3.0,
213
+ "eval_accuracy": 0.9027,
214
+ "eval_loss": 0.2705931067466736,
215
+ "eval_runtime": 231.0113,
216
+ "eval_samples_per_second": 10.822,
217
+ "eval_steps_per_second": 10.822,
218
+ "step": 264
219
+ },
220
+ {
221
+ "epoch": 3.0681818181818183,
222
+ "grad_norm": 0.42733630537986755,
223
+ "learning_rate": 5.675847473157485e-05,
224
+ "loss": 0.14,
225
+ "step": 270
226
+ },
227
+ {
228
+ "epoch": 3.1818181818181817,
229
+ "grad_norm": 0.5972977876663208,
230
+ "learning_rate": 5.3469496318302204e-05,
231
+ "loss": 0.1197,
232
+ "step": 280
233
+ },
234
+ {
235
+ "epoch": 3.2954545454545454,
236
+ "grad_norm": 0.4995785653591156,
237
+ "learning_rate": 5.016534668039976e-05,
238
+ "loss": 0.1198,
239
+ "step": 290
240
+ },
241
+ {
242
+ "epoch": 3.409090909090909,
243
+ "grad_norm": 0.5500032305717468,
244
+ "learning_rate": 4.6860474023534335e-05,
245
+ "loss": 0.1131,
246
+ "step": 300
247
+ },
248
+ {
249
+ "epoch": 3.5227272727272725,
250
+ "grad_norm": 0.4452584683895111,
251
+ "learning_rate": 4.3569329714950704e-05,
252
+ "loss": 0.1185,
253
+ "step": 310
254
+ },
255
+ {
256
+ "epoch": 3.6363636363636362,
257
+ "grad_norm": 0.4754205346107483,
258
+ "learning_rate": 4.0306305091319595e-05,
259
+ "loss": 0.1197,
260
+ "step": 320
261
+ },
262
+ {
263
+ "epoch": 3.75,
264
+ "grad_norm": 0.6347799301147461,
265
+ "learning_rate": 3.7085668529084184e-05,
266
+ "loss": 0.122,
267
+ "step": 330
268
+ },
269
+ {
270
+ "epoch": 3.8636363636363638,
271
+ "grad_norm": 0.48911160230636597,
272
+ "learning_rate": 3.392150305248024e-05,
273
+ "loss": 0.1163,
274
+ "step": 340
275
+ },
276
+ {
277
+ "epoch": 3.9772727272727275,
278
+ "grad_norm": 0.6460514068603516,
279
+ "learning_rate": 3.082764475205442e-05,
280
+ "loss": 0.1263,
281
+ "step": 350
282
+ },
283
+ {
284
+ "epoch": 4.0,
285
+ "eval_accuracy": 0.8993666666666668,
286
+ "eval_loss": 0.2945823669433594,
287
+ "eval_runtime": 233.0443,
288
+ "eval_samples_per_second": 10.728,
289
+ "eval_steps_per_second": 10.728,
290
+ "step": 352
291
+ },
292
+ {
293
+ "epoch": 4.090909090909091,
294
+ "grad_norm": 0.37293320894241333,
295
+ "learning_rate": 2.7817622282960815e-05,
296
+ "loss": 0.0856,
297
+ "step": 360
298
+ },
299
+ {
300
+ "epoch": 4.204545454545454,
301
+ "grad_norm": 0.5676562190055847,
302
+ "learning_rate": 2.490459770759398e-05,
303
+ "loss": 0.0661,
304
+ "step": 370
305
+ },
306
+ {
307
+ "epoch": 4.318181818181818,
308
+ "grad_norm": 0.5680781006813049,
309
+ "learning_rate": 2.2101308941239203e-05,
310
+ "loss": 0.061,
311
+ "step": 380
312
+ },
313
+ {
314
+ "epoch": 4.431818181818182,
315
+ "grad_norm": 0.690169095993042,
316
+ "learning_rate": 1.942001405240979e-05,
317
+ "loss": 0.0744,
318
+ "step": 390
319
+ },
320
+ {
321
+ "epoch": 4.545454545454545,
322
+ "grad_norm": 0.5858839750289917,
323
+ "learning_rate": 1.6872437661432517e-05,
324
+ "loss": 0.0736,
325
+ "step": 400
326
+ },
327
+ {
328
+ "epoch": 4.659090909090909,
329
+ "grad_norm": 0.6473811268806458,
330
+ "learning_rate": 1.4469719671666043e-05,
331
+ "loss": 0.0779,
332
+ "step": 410
333
+ },
334
+ {
335
+ "epoch": 4.7727272727272725,
336
+ "grad_norm": 0.3694300055503845,
337
+ "learning_rate": 1.2222366557537911e-05,
338
+ "loss": 0.075,
339
+ "step": 420
340
+ },
341
+ {
342
+ "epoch": 4.886363636363637,
343
+ "grad_norm": 0.5935441851615906,
344
+ "learning_rate": 1.0140205422405214e-05,
345
+ "loss": 0.0752,
346
+ "step": 430
347
+ },
348
+ {
349
+ "epoch": 5.0,
350
+ "grad_norm": 0.7272607684135437,
351
+ "learning_rate": 8.232341027131885e-06,
352
+ "loss": 0.0684,
353
+ "step": 440
354
+ },
355
+ {
356
+ "epoch": 5.0,
357
+ "eval_accuracy": 0.8996666666666668,
358
+ "eval_loss": 0.369967520236969,
359
+ "eval_runtime": 232.4252,
360
+ "eval_samples_per_second": 10.756,
361
+ "eval_steps_per_second": 10.756,
362
+ "step": 440
363
+ }
364
+ ],
365
+ "logging_steps": 10,
366
+ "max_steps": 528,
367
+ "num_input_tokens_seen": 0,
368
+ "num_train_epochs": 6,
369
+ "save_steps": 88,
370
+ "stateful_callbacks": {
371
+ "TrainerControl": {
372
+ "args": {
373
+ "should_epoch_stop": false,
374
+ "should_evaluate": false,
375
+ "should_log": false,
376
+ "should_save": true,
377
+ "should_training_stop": false
378
+ },
379
+ "attributes": {}
380
+ }
381
+ },
382
+ "total_flos": 2.420046524577743e+18,
383
+ "train_batch_size": 32,
384
+ "trial_name": null,
385
+ "trial_params": null
386
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-440/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d5c2bfb768f1720511bef6e983b38242156f823ff83caba648f7520ad9d664c
3
+ size 5304
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: internlm/internlm2_5-7b-chat-1m
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.11.1
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/adapter_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "internlm/internlm2_5-7b-chat-1m",
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
+ "wqkv",
24
+ "w2",
25
+ "w1",
26
+ "w3",
27
+ "wo"
28
+ ],
29
+ "task_type": "CAUSAL_LM",
30
+ "use_dora": false,
31
+ "use_rslora": false
32
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92a2e3824954685b0ea8fb8a04cc2b4db2cfebb48037425fd844501b0c301050
3
+ size 75539712
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a24c92a3e00afe3d9c670aa108bdfe4207517a2fec62d3e953239e6b69ff592d
3
+ size 151264058
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3e5d946241df2516b06d7074d8779088eae7607173ad780df56583910a9589b
3
+ size 14244
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f760752c4266a113f3e31ae4fd0ef06b844dcb204fbf0c40e6c00f707b3df523
3
+ size 1064
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/special_tokens_map.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|action_start|>",
6
+ "<|action_end|>",
7
+ "<|interpreter|>",
8
+ "<|plugin|>"
9
+ ],
10
+ "bos_token": {
11
+ "content": "<s>",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ },
17
+ "eos_token": {
18
+ "content": "</s>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": {
25
+ "content": "</s>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ },
31
+ "unk_token": {
32
+ "content": "<unk>",
33
+ "lstrip": false,
34
+ "normalized": false,
35
+ "rstrip": false,
36
+ "single_word": false
37
+ }
38
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenization_internlm2.py ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on transformers/src/transformers/models/llama/tokenization_llama.py
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tokenization classes for InternLM."""
19
+ import os
20
+ from shutil import copyfile
21
+ from typing import Any, Dict, List, Optional, Tuple
22
+
23
+ import sentencepiece as spm
24
+ from transformers.tokenization_utils import PreTrainedTokenizer
25
+ from transformers.utils import logging
26
+
27
+ logger = logging.get_logger(__name__)
28
+
29
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
30
+
31
+ PRETRAINED_VOCAB_FILES_MAP = {}
32
+
33
+
34
+ # Modified from transformers.model.llama.tokenization_llama.LlamaTokenizer
35
+ class InternLM2Tokenizer(PreTrainedTokenizer):
36
+ """
37
+ Construct a InternLM2 tokenizer. Based on byte-level Byte-Pair-Encoding.
38
+
39
+ Args:
40
+ vocab_file (`str`):
41
+ Path to the vocabulary file.
42
+ """
43
+
44
+ vocab_files_names = VOCAB_FILES_NAMES
45
+ pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
46
+ model_input_names = ["input_ids", "attention_mask"]
47
+ _auto_class = "AutoTokenizer"
48
+
49
+ def __init__(
50
+ self,
51
+ vocab_file,
52
+ unk_token="<unk>",
53
+ bos_token="<s>",
54
+ eos_token="</s>",
55
+ pad_token="</s>",
56
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
57
+ add_bos_token=True,
58
+ add_eos_token=False,
59
+ decode_with_prefix_space=False,
60
+ clean_up_tokenization_spaces=False,
61
+ **kwargs,
62
+ ):
63
+ self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
64
+ self.vocab_file = vocab_file
65
+ self.add_bos_token = add_bos_token
66
+ self.add_eos_token = add_eos_token
67
+ self.decode_with_prefix_space = decode_with_prefix_space
68
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
69
+ self.sp_model.Load(vocab_file)
70
+ self._no_prefix_space_tokens = None
71
+ super().__init__(
72
+ bos_token=bos_token,
73
+ eos_token=eos_token,
74
+ unk_token=unk_token,
75
+ pad_token=pad_token,
76
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
77
+ **kwargs,
78
+ )
79
+
80
+ @property
81
+ def no_prefix_space_tokens(self):
82
+ if self._no_prefix_space_tokens is None:
83
+ vocab = self.convert_ids_to_tokens(list(range(self.vocab_size)))
84
+ self._no_prefix_space_tokens = {i for i, tok in enumerate(vocab) if not tok.startswith("▁")}
85
+ return self._no_prefix_space_tokens
86
+
87
+ @property
88
+ def vocab_size(self):
89
+ """Returns vocab size"""
90
+ return self.sp_model.get_piece_size()
91
+
92
+ @property
93
+ def bos_token_id(self) -> Optional[int]:
94
+ return self.sp_model.bos_id()
95
+
96
+ @property
97
+ def eos_token_id(self) -> Optional[int]:
98
+ return self.sp_model.eos_id()
99
+
100
+ def get_vocab(self):
101
+ """Returns vocab as a dict"""
102
+ vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
103
+ vocab.update(self.added_tokens_encoder)
104
+ return vocab
105
+
106
+ def _tokenize(self, text):
107
+ """Returns a tokenized string."""
108
+ return self.sp_model.encode(text, out_type=str)
109
+
110
+ def _convert_token_to_id(self, token):
111
+ """Converts a token (str) in an id using the vocab."""
112
+ return self.sp_model.piece_to_id(token)
113
+
114
+ def _convert_id_to_token(self, index):
115
+ """Converts an index (integer) in a token (str) using the vocab."""
116
+ token = self.sp_model.IdToPiece(index)
117
+ return token
118
+
119
+ def _maybe_add_prefix_space(self, tokens, decoded):
120
+ if tokens and tokens[0] not in self.no_prefix_space_tokens:
121
+ return " " + decoded
122
+ else:
123
+ return decoded
124
+
125
+ def convert_tokens_to_string(self, tokens):
126
+ """Converts a sequence of tokens (string) in a single string."""
127
+ current_sub_tokens = []
128
+ out_string = ""
129
+ prev_is_special = False
130
+ for token in tokens:
131
+ # make sure that special tokens are not decoded using sentencepiece model
132
+ if token in self.all_special_tokens:
133
+ if not prev_is_special:
134
+ out_string += " "
135
+ out_string += self.sp_model.decode(current_sub_tokens) + token
136
+ prev_is_special = True
137
+ current_sub_tokens = []
138
+ else:
139
+ current_sub_tokens.append(token)
140
+ prev_is_special = False
141
+ out_string += self.sp_model.decode(current_sub_tokens)
142
+ out_string = self.clean_up_tokenization(out_string)
143
+ out_string = self._maybe_add_prefix_space(tokens=tokens, decoded=out_string)
144
+ return out_string[1:]
145
+
146
+ def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
147
+ """
148
+ Save the vocabulary and special tokens file to a directory.
149
+
150
+ Args:
151
+ save_directory (`str`):
152
+ The directory in which to save the vocabulary.
153
+
154
+ Returns:
155
+ `Tuple(str)`: Paths to the files saved.
156
+ """
157
+ if not os.path.isdir(save_directory):
158
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
159
+ return
160
+ out_vocab_file = os.path.join(
161
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
162
+ )
163
+
164
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
165
+ copyfile(self.vocab_file, out_vocab_file)
166
+ elif not os.path.isfile(self.vocab_file):
167
+ with open(out_vocab_file, "wb") as fi:
168
+ content_spiece_model = self.sp_model.serialized_model_proto()
169
+ fi.write(content_spiece_model)
170
+
171
+ return (out_vocab_file,)
172
+
173
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
174
+ if self.add_bos_token:
175
+ bos_token_ids = [self.bos_token_id]
176
+ else:
177
+ bos_token_ids = []
178
+
179
+ output = bos_token_ids + token_ids_0
180
+
181
+ if token_ids_1 is not None:
182
+ output = output + token_ids_1
183
+
184
+ if self.add_eos_token:
185
+ output = output + [self.eos_token_id]
186
+
187
+ return output
188
+
189
+ def get_special_tokens_mask(
190
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
191
+ ) -> List[int]:
192
+ """
193
+ Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
194
+ special tokens using the tokenizer `prepare_for_model` method.
195
+
196
+ Args:
197
+ token_ids_0 (`List[int]`):
198
+ List of IDs.
199
+ token_ids_1 (`List[int]`, *optional*):
200
+ Optional second list of IDs for sequence pairs.
201
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
202
+ Whether or not the token list is already formatted with special tokens for the model.
203
+
204
+ Returns:
205
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
206
+ """
207
+ if already_has_special_tokens:
208
+ return super().get_special_tokens_mask(
209
+ token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
210
+ )
211
+
212
+ if token_ids_1 is None:
213
+ return [1] + ([0] * len(token_ids_0)) + [1]
214
+ return [1] + ([0] * len(token_ids_0)) + [1, 1] + ([0] * len(token_ids_1)) + [1]
215
+
216
+ def create_token_type_ids_from_sequences(
217
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
218
+ ) -> List[int]:
219
+ """
220
+ Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
221
+ use of token type ids, therefore a list of zeros is returned.
222
+
223
+ Args:
224
+ token_ids_0 (`List[int]`):
225
+ List of IDs.
226
+ token_ids_1 (`List[int]`, *optional*):
227
+ Optional second list of IDs for sequence pairs.
228
+
229
+ Returns:
230
+ `List[int]`: List of zeros.
231
+ """
232
+ eos = [self.eos_token_id]
233
+
234
+ if token_ids_1 is None:
235
+ return len(token_ids_0 + eos) * [0]
236
+ return len(token_ids_0 + eos + token_ids_1 + eos) * [0]
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenization_internlm2_fast.py ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on transformers/src/transformers/models/llama/tokenization_llama_fast.py
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tokenization Fast class for InternLM."""
19
+ import os
20
+ from shutil import copyfile
21
+ from typing import Any, Dict, Optional, Tuple
22
+
23
+ from tokenizers import processors, decoders, Tokenizer, normalizers
24
+ from tokenizers.models import BPE
25
+
26
+ from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
27
+ from transformers.utils import logging
28
+
29
+ from transformers.convert_slow_tokenizer import (
30
+ SLOW_TO_FAST_CONVERTERS,
31
+ SpmConverter,
32
+ SentencePieceExtractor,
33
+ )
34
+
35
+ from .tokenization_internlm2 import InternLM2Tokenizer
36
+
37
+ logger = logging.get_logger(__name__)
38
+
39
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
40
+
41
+ # Modified from transformers.convert_slow_tokenizer.LlamaConverter
42
+ class InternLM2Converter(SpmConverter):
43
+ handle_byte_fallback = True
44
+
45
+ def vocab(self, proto):
46
+ vocab = [
47
+ ("<unk>", 0.0),
48
+ ("<s>", 0.0),
49
+ ("</s>", 0.0),
50
+ ]
51
+ vocab += [(piece.piece, piece.score) for piece in proto.pieces[3:]]
52
+ return vocab
53
+
54
+ def unk_id(self, proto):
55
+ unk_id = 0
56
+ return unk_id
57
+
58
+ def decoder(self, replacement, add_prefix_space):
59
+ decoders_sequence = [
60
+ decoders.Replace("▁", " "),
61
+ decoders.ByteFallback(),
62
+ decoders.Fuse(),
63
+ ]
64
+ if self.proto.normalizer_spec.add_dummy_prefix:
65
+ decoders_sequence.append(decoders.Strip(content=" ", left=1))
66
+ return decoders.Sequence(decoders_sequence)
67
+
68
+ def tokenizer(self, proto):
69
+ model_type = proto.trainer_spec.model_type
70
+ vocab_scores = self.vocab(proto)
71
+ # special tokens
72
+ added_tokens = self.original_tokenizer.added_tokens_decoder
73
+ for i in range(len(vocab_scores)):
74
+ piece, score = vocab_scores[i]
75
+ if i in added_tokens:
76
+ vocab_scores[i] = (added_tokens[i].content, score)
77
+ if model_type == 1:
78
+ raise RuntimeError("InternLM2 is supposed to be a BPE model!")
79
+
80
+ elif model_type == 2:
81
+ _, merges = SentencePieceExtractor(self.original_tokenizer.vocab_file).extract(vocab_scores)
82
+ bpe_vocab = {word: i for i, (word, _score) in enumerate(vocab_scores)}
83
+ tokenizer = Tokenizer(
84
+ BPE(bpe_vocab, merges, unk_token=proto.trainer_spec.unk_piece, fuse_unk=True, byte_fallback=True)
85
+ )
86
+ tokenizer.add_special_tokens(
87
+ [ added_token for index, added_token in added_tokens.items()]
88
+ )
89
+ else:
90
+ raise Exception(
91
+ "You're trying to run a `Unigram` model but you're file was trained with a different algorithm"
92
+ )
93
+
94
+ return tokenizer
95
+
96
+ def normalizer(self, proto):
97
+ normalizers_list = []
98
+ if proto.normalizer_spec.add_dummy_prefix:
99
+ normalizers_list.append(normalizers.Prepend(prepend="▁"))
100
+ normalizers_list.append(normalizers.Replace(pattern=" ", content="▁"))
101
+ return normalizers.Sequence(normalizers_list)
102
+
103
+ def pre_tokenizer(self, replacement, add_prefix_space):
104
+ return None
105
+
106
+ SLOW_TO_FAST_CONVERTERS["InternLM2Tokenizer"] = InternLM2Converter
107
+
108
+
109
+ # Modified from transformers.model.llama.tokenization_llama_fast.LlamaTokenizerFast -> InternLM2TokenizerFast
110
+ class InternLM2TokenizerFast(PreTrainedTokenizerFast):
111
+ vocab_files_names = VOCAB_FILES_NAMES
112
+ slow_tokenizer_class = InternLM2Tokenizer
113
+ padding_side = "left"
114
+ model_input_names = ["input_ids", "attention_mask"]
115
+ _auto_class = "AutoTokenizer"
116
+
117
+ def __init__(
118
+ self,
119
+ vocab_file,
120
+ unk_token="<unk>",
121
+ bos_token="<s>",
122
+ eos_token="</s>",
123
+ pad_token="</s>",
124
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
125
+ add_bos_token=True,
126
+ add_eos_token=False,
127
+ decode_with_prefix_space=False,
128
+ clean_up_tokenization_spaces=False,
129
+ **kwargs,
130
+ ):
131
+ super().__init__(
132
+ vocab_file=vocab_file,
133
+ unk_token=unk_token,
134
+ bos_token=bos_token,
135
+ eos_token=eos_token,
136
+ pad_token=pad_token,
137
+ sp_model_kwargs=sp_model_kwargs,
138
+ add_bos_token=add_bos_token,
139
+ add_eos_token=add_eos_token,
140
+ decode_with_prefix_space=decode_with_prefix_space,
141
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
142
+ **kwargs,
143
+ )
144
+ self._add_bos_token = add_bos_token
145
+ self._add_eos_token = add_eos_token
146
+ self.update_post_processor()
147
+ self.vocab_file = vocab_file
148
+
149
+ @property
150
+ def can_save_slow_tokenizer(self) -> bool:
151
+ return os.path.isfile(self.vocab_file) if self.vocab_file else False
152
+
153
+ def update_post_processor(self):
154
+ """
155
+ Updates the underlying post processor with the current `bos_token` and `eos_token`.
156
+ """
157
+ bos = self.bos_token
158
+ bos_token_id = self.bos_token_id
159
+ if bos is None and self.add_bos_token:
160
+ raise ValueError("add_bos_token = True but bos_token = None")
161
+
162
+ eos = self.eos_token
163
+ eos_token_id = self.eos_token_id
164
+ if eos is None and self.add_eos_token:
165
+ raise ValueError("add_eos_token = True but eos_token = None")
166
+
167
+ single = f"{(bos+':0 ') if self.add_bos_token else ''}$A:0{(' '+eos+':0') if self.add_eos_token else ''}"
168
+ pair = f"{single}{(' '+bos+':1') if self.add_bos_token else ''} $B:1{(' '+eos+':1') if self.add_eos_token else ''}"
169
+
170
+ special_tokens = []
171
+ if self.add_bos_token:
172
+ special_tokens.append((bos, bos_token_id))
173
+ if self.add_eos_token:
174
+ special_tokens.append((eos, eos_token_id))
175
+ self._tokenizer.post_processor = processors.TemplateProcessing(
176
+ single=single, pair=pair, special_tokens=special_tokens
177
+ )
178
+
179
+ @property
180
+ def add_eos_token(self):
181
+ return self._add_eos_token
182
+
183
+ @property
184
+ def add_bos_token(self):
185
+ return self._add_bos_token
186
+
187
+ @add_eos_token.setter
188
+ def add_eos_token(self, value):
189
+ self._add_eos_token = value
190
+ self.update_post_processor()
191
+
192
+ @add_bos_token.setter
193
+ def add_bos_token(self, value):
194
+ self._add_bos_token = value
195
+ self.update_post_processor()
196
+
197
+ def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
198
+ if not self.can_save_slow_tokenizer:
199
+ raise ValueError(
200
+ "Your fast tokenizer does not have the necessary information to save the vocabulary for a slow "
201
+ "tokenizer."
202
+ )
203
+
204
+ if not os.path.isdir(save_directory):
205
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
206
+ return
207
+ out_vocab_file = os.path.join(
208
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
209
+ )
210
+
211
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file):
212
+ copyfile(self.vocab_file, out_vocab_file)
213
+
214
+ return (out_vocab_file,)
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f868398fc4e05ee1e8aeba95ddf18ddcc45b8bce55d5093bead5bbf80429b48b
3
+ size 1477754
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/tokenizer_config.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "92538": {
30
+ "content": "<|plugin|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "92539": {
38
+ "content": "<|interpreter|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "92540": {
46
+ "content": "<|action_end|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "92541": {
54
+ "content": "<|action_start|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "92542": {
62
+ "content": "<|im_end|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "92543": {
70
+ "content": "<|im_start|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ }
77
+ },
78
+ "additional_special_tokens": [
79
+ "<|im_start|>",
80
+ "<|im_end|>",
81
+ "<|action_start|>",
82
+ "<|action_end|>",
83
+ "<|interpreter|>",
84
+ "<|plugin|>"
85
+ ],
86
+ "auto_map": {
87
+ "AutoTokenizer": [
88
+ "tokenization_internlm2.InternLM2Tokenizer",
89
+ "tokenization_internlm2_fast.InternLM2TokenizerFast"
90
+ ]
91
+ },
92
+ "bos_token": "<s>",
93
+ "chat_template": "{{ '<s>' }}{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + content + '<|im_end|>\n<|im_start|>assistant\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>\n' }}{% endif %}{% endfor %}",
94
+ "clean_up_tokenization_spaces": false,
95
+ "decode_with_prefix_space": false,
96
+ "eos_token": "</s>",
97
+ "model_max_length": 1000000000000000019884624838656,
98
+ "pad_token": "</s>",
99
+ "padding_side": "right",
100
+ "sp_model_kwargs": null,
101
+ "split_special_tokens": false,
102
+ "tokenizer_class": "InternLM2Tokenizer",
103
+ "unk_token": "<unk>"
104
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/trainer_state.json ADDED
@@ -0,0 +1,451 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 6.0,
5
+ "eval_steps": 88,
6
+ "global_step": 528,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.11363636363636363,
13
+ "grad_norm": 3.514838457107544,
14
+ "learning_rate": 1.8867924528301888e-05,
15
+ "loss": 6.943,
16
+ "step": 10
17
+ },
18
+ {
19
+ "epoch": 0.22727272727272727,
20
+ "grad_norm": 1.0595427751541138,
21
+ "learning_rate": 3.7735849056603776e-05,
22
+ "loss": 0.446,
23
+ "step": 20
24
+ },
25
+ {
26
+ "epoch": 0.3409090909090909,
27
+ "grad_norm": 0.6256385445594788,
28
+ "learning_rate": 5.660377358490566e-05,
29
+ "loss": 0.3515,
30
+ "step": 30
31
+ },
32
+ {
33
+ "epoch": 0.45454545454545453,
34
+ "grad_norm": 0.633573055267334,
35
+ "learning_rate": 7.547169811320755e-05,
36
+ "loss": 0.288,
37
+ "step": 40
38
+ },
39
+ {
40
+ "epoch": 0.5681818181818182,
41
+ "grad_norm": 0.4915701746940613,
42
+ "learning_rate": 9.433962264150944e-05,
43
+ "loss": 0.2819,
44
+ "step": 50
45
+ },
46
+ {
47
+ "epoch": 0.6818181818181818,
48
+ "grad_norm": 0.40083640813827515,
49
+ "learning_rate": 9.994642390694308e-05,
50
+ "loss": 0.2765,
51
+ "step": 60
52
+ },
53
+ {
54
+ "epoch": 0.7954545454545454,
55
+ "grad_norm": 0.7176418304443359,
56
+ "learning_rate": 9.968428675226714e-05,
57
+ "loss": 0.2754,
58
+ "step": 70
59
+ },
60
+ {
61
+ "epoch": 0.9090909090909091,
62
+ "grad_norm": 0.6853049397468567,
63
+ "learning_rate": 9.92048928531717e-05,
64
+ "loss": 0.277,
65
+ "step": 80
66
+ },
67
+ {
68
+ "epoch": 1.0,
69
+ "eval_accuracy": 0.9030666666666668,
70
+ "eval_loss": 0.26003387570381165,
71
+ "eval_runtime": 231.9406,
72
+ "eval_samples_per_second": 10.779,
73
+ "eval_steps_per_second": 10.779,
74
+ "step": 88
75
+ },
76
+ {
77
+ "epoch": 1.0227272727272727,
78
+ "grad_norm": 0.4268323481082916,
79
+ "learning_rate": 9.851033847720166e-05,
80
+ "loss": 0.2619,
81
+ "step": 90
82
+ },
83
+ {
84
+ "epoch": 1.1363636363636362,
85
+ "grad_norm": 0.9503114819526672,
86
+ "learning_rate": 9.760366073392246e-05,
87
+ "loss": 0.2385,
88
+ "step": 100
89
+ },
90
+ {
91
+ "epoch": 1.25,
92
+ "grad_norm": 0.3606574237346649,
93
+ "learning_rate": 9.648882429441257e-05,
94
+ "loss": 0.2341,
95
+ "step": 110
96
+ },
97
+ {
98
+ "epoch": 1.3636363636363638,
99
+ "grad_norm": 0.7226484417915344,
100
+ "learning_rate": 9.517070405476575e-05,
101
+ "loss": 0.2447,
102
+ "step": 120
103
+ },
104
+ {
105
+ "epoch": 1.4772727272727273,
106
+ "grad_norm": 0.8543397188186646,
107
+ "learning_rate": 9.365506381941066e-05,
108
+ "loss": 0.2441,
109
+ "step": 130
110
+ },
111
+ {
112
+ "epoch": 1.5909090909090908,
113
+ "grad_norm": 0.800394594669342,
114
+ "learning_rate": 9.194853109746074e-05,
115
+ "loss": 0.2379,
116
+ "step": 140
117
+ },
118
+ {
119
+ "epoch": 1.7045454545454546,
120
+ "grad_norm": 0.5756838321685791,
121
+ "learning_rate": 9.005856812230304e-05,
122
+ "loss": 0.2434,
123
+ "step": 150
124
+ },
125
+ {
126
+ "epoch": 1.8181818181818183,
127
+ "grad_norm": 1.0771032571792603,
128
+ "learning_rate": 8.799343922115044e-05,
129
+ "loss": 0.2352,
130
+ "step": 160
131
+ },
132
+ {
133
+ "epoch": 1.9318181818181817,
134
+ "grad_norm": 0.4805872440338135,
135
+ "learning_rate": 8.576217467724128e-05,
136
+ "loss": 0.2427,
137
+ "step": 170
138
+ },
139
+ {
140
+ "epoch": 2.0,
141
+ "eval_accuracy": 0.9006,
142
+ "eval_loss": 0.25738978385925293,
143
+ "eval_runtime": 231.2131,
144
+ "eval_samples_per_second": 10.813,
145
+ "eval_steps_per_second": 10.813,
146
+ "step": 176
147
+ },
148
+ {
149
+ "epoch": 2.0454545454545454,
150
+ "grad_norm": 0.5219587683677673,
151
+ "learning_rate": 8.337453124270863e-05,
152
+ "loss": 0.22,
153
+ "step": 180
154
+ },
155
+ {
156
+ "epoch": 2.159090909090909,
157
+ "grad_norm": 0.6363154053688049,
158
+ "learning_rate": 8.084094947478556e-05,
159
+ "loss": 0.1787,
160
+ "step": 190
161
+ },
162
+ {
163
+ "epoch": 2.2727272727272725,
164
+ "grad_norm": 0.6807820796966553,
165
+ "learning_rate": 7.817250808190483e-05,
166
+ "loss": 0.1647,
167
+ "step": 200
168
+ },
169
+ {
170
+ "epoch": 2.3863636363636362,
171
+ "grad_norm": 0.5443515777587891,
172
+ "learning_rate": 7.538087547932585e-05,
173
+ "loss": 0.1828,
174
+ "step": 210
175
+ },
176
+ {
177
+ "epoch": 2.5,
178
+ "grad_norm": 0.4641902446746826,
179
+ "learning_rate": 7.247825876612353e-05,
180
+ "loss": 0.1782,
181
+ "step": 220
182
+ },
183
+ {
184
+ "epoch": 2.6136363636363638,
185
+ "grad_norm": 0.5865933299064636,
186
+ "learning_rate": 6.947735034665002e-05,
187
+ "loss": 0.1942,
188
+ "step": 230
189
+ },
190
+ {
191
+ "epoch": 2.7272727272727275,
192
+ "grad_norm": 0.5332173705101013,
193
+ "learning_rate": 6.639127242987988e-05,
194
+ "loss": 0.1852,
195
+ "step": 240
196
+ },
197
+ {
198
+ "epoch": 2.840909090909091,
199
+ "grad_norm": 0.5550218820571899,
200
+ "learning_rate": 6.323351964932908e-05,
201
+ "loss": 0.1936,
202
+ "step": 250
203
+ },
204
+ {
205
+ "epoch": 2.9545454545454546,
206
+ "grad_norm": 0.6850063800811768,
207
+ "learning_rate": 6.001790005445607e-05,
208
+ "loss": 0.1813,
209
+ "step": 260
210
+ },
211
+ {
212
+ "epoch": 3.0,
213
+ "eval_accuracy": 0.9027,
214
+ "eval_loss": 0.2705931067466736,
215
+ "eval_runtime": 231.0113,
216
+ "eval_samples_per_second": 10.822,
217
+ "eval_steps_per_second": 10.822,
218
+ "step": 264
219
+ },
220
+ {
221
+ "epoch": 3.0681818181818183,
222
+ "grad_norm": 0.42733630537986755,
223
+ "learning_rate": 5.675847473157485e-05,
224
+ "loss": 0.14,
225
+ "step": 270
226
+ },
227
+ {
228
+ "epoch": 3.1818181818181817,
229
+ "grad_norm": 0.5972977876663208,
230
+ "learning_rate": 5.3469496318302204e-05,
231
+ "loss": 0.1197,
232
+ "step": 280
233
+ },
234
+ {
235
+ "epoch": 3.2954545454545454,
236
+ "grad_norm": 0.4995785653591156,
237
+ "learning_rate": 5.016534668039976e-05,
238
+ "loss": 0.1198,
239
+ "step": 290
240
+ },
241
+ {
242
+ "epoch": 3.409090909090909,
243
+ "grad_norm": 0.5500032305717468,
244
+ "learning_rate": 4.6860474023534335e-05,
245
+ "loss": 0.1131,
246
+ "step": 300
247
+ },
248
+ {
249
+ "epoch": 3.5227272727272725,
250
+ "grad_norm": 0.4452584683895111,
251
+ "learning_rate": 4.3569329714950704e-05,
252
+ "loss": 0.1185,
253
+ "step": 310
254
+ },
255
+ {
256
+ "epoch": 3.6363636363636362,
257
+ "grad_norm": 0.4754205346107483,
258
+ "learning_rate": 4.0306305091319595e-05,
259
+ "loss": 0.1197,
260
+ "step": 320
261
+ },
262
+ {
263
+ "epoch": 3.75,
264
+ "grad_norm": 0.6347799301147461,
265
+ "learning_rate": 3.7085668529084184e-05,
266
+ "loss": 0.122,
267
+ "step": 330
268
+ },
269
+ {
270
+ "epoch": 3.8636363636363638,
271
+ "grad_norm": 0.48911160230636597,
272
+ "learning_rate": 3.392150305248024e-05,
273
+ "loss": 0.1163,
274
+ "step": 340
275
+ },
276
+ {
277
+ "epoch": 3.9772727272727275,
278
+ "grad_norm": 0.6460514068603516,
279
+ "learning_rate": 3.082764475205442e-05,
280
+ "loss": 0.1263,
281
+ "step": 350
282
+ },
283
+ {
284
+ "epoch": 4.0,
285
+ "eval_accuracy": 0.8993666666666668,
286
+ "eval_loss": 0.2945823669433594,
287
+ "eval_runtime": 233.0443,
288
+ "eval_samples_per_second": 10.728,
289
+ "eval_steps_per_second": 10.728,
290
+ "step": 352
291
+ },
292
+ {
293
+ "epoch": 4.090909090909091,
294
+ "grad_norm": 0.37293320894241333,
295
+ "learning_rate": 2.7817622282960815e-05,
296
+ "loss": 0.0856,
297
+ "step": 360
298
+ },
299
+ {
300
+ "epoch": 4.204545454545454,
301
+ "grad_norm": 0.5676562190055847,
302
+ "learning_rate": 2.490459770759398e-05,
303
+ "loss": 0.0661,
304
+ "step": 370
305
+ },
306
+ {
307
+ "epoch": 4.318181818181818,
308
+ "grad_norm": 0.5680781006813049,
309
+ "learning_rate": 2.2101308941239203e-05,
310
+ "loss": 0.061,
311
+ "step": 380
312
+ },
313
+ {
314
+ "epoch": 4.431818181818182,
315
+ "grad_norm": 0.690169095993042,
316
+ "learning_rate": 1.942001405240979e-05,
317
+ "loss": 0.0744,
318
+ "step": 390
319
+ },
320
+ {
321
+ "epoch": 4.545454545454545,
322
+ "grad_norm": 0.5858839750289917,
323
+ "learning_rate": 1.6872437661432517e-05,
324
+ "loss": 0.0736,
325
+ "step": 400
326
+ },
327
+ {
328
+ "epoch": 4.659090909090909,
329
+ "grad_norm": 0.6473811268806458,
330
+ "learning_rate": 1.4469719671666043e-05,
331
+ "loss": 0.0779,
332
+ "step": 410
333
+ },
334
+ {
335
+ "epoch": 4.7727272727272725,
336
+ "grad_norm": 0.3694300055503845,
337
+ "learning_rate": 1.2222366557537911e-05,
338
+ "loss": 0.075,
339
+ "step": 420
340
+ },
341
+ {
342
+ "epoch": 4.886363636363637,
343
+ "grad_norm": 0.5935441851615906,
344
+ "learning_rate": 1.0140205422405214e-05,
345
+ "loss": 0.0752,
346
+ "step": 430
347
+ },
348
+ {
349
+ "epoch": 5.0,
350
+ "grad_norm": 0.7272607684135437,
351
+ "learning_rate": 8.232341027131885e-06,
352
+ "loss": 0.0684,
353
+ "step": 440
354
+ },
355
+ {
356
+ "epoch": 5.0,
357
+ "eval_accuracy": 0.8996666666666668,
358
+ "eval_loss": 0.369967520236969,
359
+ "eval_runtime": 232.4252,
360
+ "eval_samples_per_second": 10.756,
361
+ "eval_steps_per_second": 10.756,
362
+ "step": 440
363
+ },
364
+ {
365
+ "epoch": 5.113636363636363,
366
+ "grad_norm": 0.3855780363082886,
367
+ "learning_rate": 6.5071159772861436e-06,
368
+ "loss": 0.0531,
369
+ "step": 450
370
+ },
371
+ {
372
+ "epoch": 5.2272727272727275,
373
+ "grad_norm": 0.3242223560810089,
374
+ "learning_rate": 4.972074243048897e-06,
375
+ "loss": 0.0437,
376
+ "step": 460
377
+ },
378
+ {
379
+ "epoch": 5.340909090909091,
380
+ "grad_norm": 0.36955130100250244,
381
+ "learning_rate": 3.6339281713517303e-06,
382
+ "loss": 0.0463,
383
+ "step": 470
384
+ },
385
+ {
386
+ "epoch": 5.454545454545454,
387
+ "grad_norm": 0.3851165473461151,
388
+ "learning_rate": 2.4985291344915674e-06,
389
+ "loss": 0.0485,
390
+ "step": 480
391
+ },
392
+ {
393
+ "epoch": 5.568181818181818,
394
+ "grad_norm": 0.30520951747894287,
395
+ "learning_rate": 1.5708419435684462e-06,
396
+ "loss": 0.0495,
397
+ "step": 490
398
+ },
399
+ {
400
+ "epoch": 5.681818181818182,
401
+ "grad_norm": 0.8094011545181274,
402
+ "learning_rate": 8.549231386298151e-07,
403
+ "loss": 0.0484,
404
+ "step": 500
405
+ },
406
+ {
407
+ "epoch": 5.795454545454545,
408
+ "grad_norm": 0.21888971328735352,
409
+ "learning_rate": 3.5390325045304706e-07,
410
+ "loss": 0.0384,
411
+ "step": 510
412
+ },
413
+ {
414
+ "epoch": 5.909090909090909,
415
+ "grad_norm": 0.4017506539821625,
416
+ "learning_rate": 6.997311153086883e-08,
417
+ "loss": 0.0486,
418
+ "step": 520
419
+ },
420
+ {
421
+ "epoch": 6.0,
422
+ "eval_accuracy": 0.8984,
423
+ "eval_loss": 0.4368518590927124,
424
+ "eval_runtime": 232.9443,
425
+ "eval_samples_per_second": 10.732,
426
+ "eval_steps_per_second": 10.732,
427
+ "step": 528
428
+ }
429
+ ],
430
+ "logging_steps": 10,
431
+ "max_steps": 528,
432
+ "num_input_tokens_seen": 0,
433
+ "num_train_epochs": 6,
434
+ "save_steps": 88,
435
+ "stateful_callbacks": {
436
+ "TrainerControl": {
437
+ "args": {
438
+ "should_epoch_stop": false,
439
+ "should_evaluate": false,
440
+ "should_log": false,
441
+ "should_save": true,
442
+ "should_training_stop": true
443
+ },
444
+ "attributes": {}
445
+ }
446
+ },
447
+ "total_flos": 2.9041541335076045e+18,
448
+ "train_batch_size": 32,
449
+ "trial_name": null,
450
+ "trial_params": null
451
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/checkpoint-528/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d5c2bfb768f1720511bef6e983b38242156f823ff83caba648f7520ad9d664c
3
+ size 5304
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/eval_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 6.0,
3
+ "eval_accuracy": 0.8984,
4
+ "eval_loss": 0.4368518590927124,
5
+ "eval_runtime": 232.12,
6
+ "eval_samples_per_second": 10.77,
7
+ "eval_steps_per_second": 10.77
8
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/special_tokens_map.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|action_start|>",
6
+ "<|action_end|>",
7
+ "<|interpreter|>",
8
+ "<|plugin|>"
9
+ ],
10
+ "bos_token": {
11
+ "content": "<s>",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ },
17
+ "eos_token": {
18
+ "content": "</s>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": {
25
+ "content": "</s>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ },
31
+ "unk_token": {
32
+ "content": "<unk>",
33
+ "lstrip": false,
34
+ "normalized": false,
35
+ "rstrip": false,
36
+ "single_word": false
37
+ }
38
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenization_internlm2.py ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on transformers/src/transformers/models/llama/tokenization_llama.py
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tokenization classes for InternLM."""
19
+ import os
20
+ from shutil import copyfile
21
+ from typing import Any, Dict, List, Optional, Tuple
22
+
23
+ import sentencepiece as spm
24
+ from transformers.tokenization_utils import PreTrainedTokenizer
25
+ from transformers.utils import logging
26
+
27
+ logger = logging.get_logger(__name__)
28
+
29
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
30
+
31
+ PRETRAINED_VOCAB_FILES_MAP = {}
32
+
33
+
34
+ # Modified from transformers.model.llama.tokenization_llama.LlamaTokenizer
35
+ class InternLM2Tokenizer(PreTrainedTokenizer):
36
+ """
37
+ Construct a InternLM2 tokenizer. Based on byte-level Byte-Pair-Encoding.
38
+
39
+ Args:
40
+ vocab_file (`str`):
41
+ Path to the vocabulary file.
42
+ """
43
+
44
+ vocab_files_names = VOCAB_FILES_NAMES
45
+ pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
46
+ model_input_names = ["input_ids", "attention_mask"]
47
+ _auto_class = "AutoTokenizer"
48
+
49
+ def __init__(
50
+ self,
51
+ vocab_file,
52
+ unk_token="<unk>",
53
+ bos_token="<s>",
54
+ eos_token="</s>",
55
+ pad_token="</s>",
56
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
57
+ add_bos_token=True,
58
+ add_eos_token=False,
59
+ decode_with_prefix_space=False,
60
+ clean_up_tokenization_spaces=False,
61
+ **kwargs,
62
+ ):
63
+ self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
64
+ self.vocab_file = vocab_file
65
+ self.add_bos_token = add_bos_token
66
+ self.add_eos_token = add_eos_token
67
+ self.decode_with_prefix_space = decode_with_prefix_space
68
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
69
+ self.sp_model.Load(vocab_file)
70
+ self._no_prefix_space_tokens = None
71
+ super().__init__(
72
+ bos_token=bos_token,
73
+ eos_token=eos_token,
74
+ unk_token=unk_token,
75
+ pad_token=pad_token,
76
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
77
+ **kwargs,
78
+ )
79
+
80
+ @property
81
+ def no_prefix_space_tokens(self):
82
+ if self._no_prefix_space_tokens is None:
83
+ vocab = self.convert_ids_to_tokens(list(range(self.vocab_size)))
84
+ self._no_prefix_space_tokens = {i for i, tok in enumerate(vocab) if not tok.startswith("▁")}
85
+ return self._no_prefix_space_tokens
86
+
87
+ @property
88
+ def vocab_size(self):
89
+ """Returns vocab size"""
90
+ return self.sp_model.get_piece_size()
91
+
92
+ @property
93
+ def bos_token_id(self) -> Optional[int]:
94
+ return self.sp_model.bos_id()
95
+
96
+ @property
97
+ def eos_token_id(self) -> Optional[int]:
98
+ return self.sp_model.eos_id()
99
+
100
+ def get_vocab(self):
101
+ """Returns vocab as a dict"""
102
+ vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
103
+ vocab.update(self.added_tokens_encoder)
104
+ return vocab
105
+
106
+ def _tokenize(self, text):
107
+ """Returns a tokenized string."""
108
+ return self.sp_model.encode(text, out_type=str)
109
+
110
+ def _convert_token_to_id(self, token):
111
+ """Converts a token (str) in an id using the vocab."""
112
+ return self.sp_model.piece_to_id(token)
113
+
114
+ def _convert_id_to_token(self, index):
115
+ """Converts an index (integer) in a token (str) using the vocab."""
116
+ token = self.sp_model.IdToPiece(index)
117
+ return token
118
+
119
+ def _maybe_add_prefix_space(self, tokens, decoded):
120
+ if tokens and tokens[0] not in self.no_prefix_space_tokens:
121
+ return " " + decoded
122
+ else:
123
+ return decoded
124
+
125
+ def convert_tokens_to_string(self, tokens):
126
+ """Converts a sequence of tokens (string) in a single string."""
127
+ current_sub_tokens = []
128
+ out_string = ""
129
+ prev_is_special = False
130
+ for token in tokens:
131
+ # make sure that special tokens are not decoded using sentencepiece model
132
+ if token in self.all_special_tokens:
133
+ if not prev_is_special:
134
+ out_string += " "
135
+ out_string += self.sp_model.decode(current_sub_tokens) + token
136
+ prev_is_special = True
137
+ current_sub_tokens = []
138
+ else:
139
+ current_sub_tokens.append(token)
140
+ prev_is_special = False
141
+ out_string += self.sp_model.decode(current_sub_tokens)
142
+ out_string = self.clean_up_tokenization(out_string)
143
+ out_string = self._maybe_add_prefix_space(tokens=tokens, decoded=out_string)
144
+ return out_string[1:]
145
+
146
+ def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
147
+ """
148
+ Save the vocabulary and special tokens file to a directory.
149
+
150
+ Args:
151
+ save_directory (`str`):
152
+ The directory in which to save the vocabulary.
153
+
154
+ Returns:
155
+ `Tuple(str)`: Paths to the files saved.
156
+ """
157
+ if not os.path.isdir(save_directory):
158
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
159
+ return
160
+ out_vocab_file = os.path.join(
161
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
162
+ )
163
+
164
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
165
+ copyfile(self.vocab_file, out_vocab_file)
166
+ elif not os.path.isfile(self.vocab_file):
167
+ with open(out_vocab_file, "wb") as fi:
168
+ content_spiece_model = self.sp_model.serialized_model_proto()
169
+ fi.write(content_spiece_model)
170
+
171
+ return (out_vocab_file,)
172
+
173
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
174
+ if self.add_bos_token:
175
+ bos_token_ids = [self.bos_token_id]
176
+ else:
177
+ bos_token_ids = []
178
+
179
+ output = bos_token_ids + token_ids_0
180
+
181
+ if token_ids_1 is not None:
182
+ output = output + token_ids_1
183
+
184
+ if self.add_eos_token:
185
+ output = output + [self.eos_token_id]
186
+
187
+ return output
188
+
189
+ def get_special_tokens_mask(
190
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
191
+ ) -> List[int]:
192
+ """
193
+ Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
194
+ special tokens using the tokenizer `prepare_for_model` method.
195
+
196
+ Args:
197
+ token_ids_0 (`List[int]`):
198
+ List of IDs.
199
+ token_ids_1 (`List[int]`, *optional*):
200
+ Optional second list of IDs for sequence pairs.
201
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
202
+ Whether or not the token list is already formatted with special tokens for the model.
203
+
204
+ Returns:
205
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
206
+ """
207
+ if already_has_special_tokens:
208
+ return super().get_special_tokens_mask(
209
+ token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
210
+ )
211
+
212
+ if token_ids_1 is None:
213
+ return [1] + ([0] * len(token_ids_0)) + [1]
214
+ return [1] + ([0] * len(token_ids_0)) + [1, 1] + ([0] * len(token_ids_1)) + [1]
215
+
216
+ def create_token_type_ids_from_sequences(
217
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
218
+ ) -> List[int]:
219
+ """
220
+ Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
221
+ use of token type ids, therefore a list of zeros is returned.
222
+
223
+ Args:
224
+ token_ids_0 (`List[int]`):
225
+ List of IDs.
226
+ token_ids_1 (`List[int]`, *optional*):
227
+ Optional second list of IDs for sequence pairs.
228
+
229
+ Returns:
230
+ `List[int]`: List of zeros.
231
+ """
232
+ eos = [self.eos_token_id]
233
+
234
+ if token_ids_1 is None:
235
+ return len(token_ids_0 + eos) * [0]
236
+ return len(token_ids_0 + eos + token_ids_1 + eos) * [0]
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenization_internlm2_fast.py ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on transformers/src/transformers/models/llama/tokenization_llama_fast.py
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tokenization Fast class for InternLM."""
19
+ import os
20
+ from shutil import copyfile
21
+ from typing import Any, Dict, Optional, Tuple
22
+
23
+ from tokenizers import processors, decoders, Tokenizer, normalizers
24
+ from tokenizers.models import BPE
25
+
26
+ from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
27
+ from transformers.utils import logging
28
+
29
+ from transformers.convert_slow_tokenizer import (
30
+ SLOW_TO_FAST_CONVERTERS,
31
+ SpmConverter,
32
+ SentencePieceExtractor,
33
+ )
34
+
35
+ from .tokenization_internlm2 import InternLM2Tokenizer
36
+
37
+ logger = logging.get_logger(__name__)
38
+
39
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
40
+
41
+ # Modified from transformers.convert_slow_tokenizer.LlamaConverter
42
+ class InternLM2Converter(SpmConverter):
43
+ handle_byte_fallback = True
44
+
45
+ def vocab(self, proto):
46
+ vocab = [
47
+ ("<unk>", 0.0),
48
+ ("<s>", 0.0),
49
+ ("</s>", 0.0),
50
+ ]
51
+ vocab += [(piece.piece, piece.score) for piece in proto.pieces[3:]]
52
+ return vocab
53
+
54
+ def unk_id(self, proto):
55
+ unk_id = 0
56
+ return unk_id
57
+
58
+ def decoder(self, replacement, add_prefix_space):
59
+ decoders_sequence = [
60
+ decoders.Replace("▁", " "),
61
+ decoders.ByteFallback(),
62
+ decoders.Fuse(),
63
+ ]
64
+ if self.proto.normalizer_spec.add_dummy_prefix:
65
+ decoders_sequence.append(decoders.Strip(content=" ", left=1))
66
+ return decoders.Sequence(decoders_sequence)
67
+
68
+ def tokenizer(self, proto):
69
+ model_type = proto.trainer_spec.model_type
70
+ vocab_scores = self.vocab(proto)
71
+ # special tokens
72
+ added_tokens = self.original_tokenizer.added_tokens_decoder
73
+ for i in range(len(vocab_scores)):
74
+ piece, score = vocab_scores[i]
75
+ if i in added_tokens:
76
+ vocab_scores[i] = (added_tokens[i].content, score)
77
+ if model_type == 1:
78
+ raise RuntimeError("InternLM2 is supposed to be a BPE model!")
79
+
80
+ elif model_type == 2:
81
+ _, merges = SentencePieceExtractor(self.original_tokenizer.vocab_file).extract(vocab_scores)
82
+ bpe_vocab = {word: i for i, (word, _score) in enumerate(vocab_scores)}
83
+ tokenizer = Tokenizer(
84
+ BPE(bpe_vocab, merges, unk_token=proto.trainer_spec.unk_piece, fuse_unk=True, byte_fallback=True)
85
+ )
86
+ tokenizer.add_special_tokens(
87
+ [ added_token for index, added_token in added_tokens.items()]
88
+ )
89
+ else:
90
+ raise Exception(
91
+ "You're trying to run a `Unigram` model but you're file was trained with a different algorithm"
92
+ )
93
+
94
+ return tokenizer
95
+
96
+ def normalizer(self, proto):
97
+ normalizers_list = []
98
+ if proto.normalizer_spec.add_dummy_prefix:
99
+ normalizers_list.append(normalizers.Prepend(prepend="▁"))
100
+ normalizers_list.append(normalizers.Replace(pattern=" ", content="▁"))
101
+ return normalizers.Sequence(normalizers_list)
102
+
103
+ def pre_tokenizer(self, replacement, add_prefix_space):
104
+ return None
105
+
106
+ SLOW_TO_FAST_CONVERTERS["InternLM2Tokenizer"] = InternLM2Converter
107
+
108
+
109
+ # Modified from transformers.model.llama.tokenization_llama_fast.LlamaTokenizerFast -> InternLM2TokenizerFast
110
+ class InternLM2TokenizerFast(PreTrainedTokenizerFast):
111
+ vocab_files_names = VOCAB_FILES_NAMES
112
+ slow_tokenizer_class = InternLM2Tokenizer
113
+ padding_side = "left"
114
+ model_input_names = ["input_ids", "attention_mask"]
115
+ _auto_class = "AutoTokenizer"
116
+
117
+ def __init__(
118
+ self,
119
+ vocab_file,
120
+ unk_token="<unk>",
121
+ bos_token="<s>",
122
+ eos_token="</s>",
123
+ pad_token="</s>",
124
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
125
+ add_bos_token=True,
126
+ add_eos_token=False,
127
+ decode_with_prefix_space=False,
128
+ clean_up_tokenization_spaces=False,
129
+ **kwargs,
130
+ ):
131
+ super().__init__(
132
+ vocab_file=vocab_file,
133
+ unk_token=unk_token,
134
+ bos_token=bos_token,
135
+ eos_token=eos_token,
136
+ pad_token=pad_token,
137
+ sp_model_kwargs=sp_model_kwargs,
138
+ add_bos_token=add_bos_token,
139
+ add_eos_token=add_eos_token,
140
+ decode_with_prefix_space=decode_with_prefix_space,
141
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
142
+ **kwargs,
143
+ )
144
+ self._add_bos_token = add_bos_token
145
+ self._add_eos_token = add_eos_token
146
+ self.update_post_processor()
147
+ self.vocab_file = vocab_file
148
+
149
+ @property
150
+ def can_save_slow_tokenizer(self) -> bool:
151
+ return os.path.isfile(self.vocab_file) if self.vocab_file else False
152
+
153
+ def update_post_processor(self):
154
+ """
155
+ Updates the underlying post processor with the current `bos_token` and `eos_token`.
156
+ """
157
+ bos = self.bos_token
158
+ bos_token_id = self.bos_token_id
159
+ if bos is None and self.add_bos_token:
160
+ raise ValueError("add_bos_token = True but bos_token = None")
161
+
162
+ eos = self.eos_token
163
+ eos_token_id = self.eos_token_id
164
+ if eos is None and self.add_eos_token:
165
+ raise ValueError("add_eos_token = True but eos_token = None")
166
+
167
+ single = f"{(bos+':0 ') if self.add_bos_token else ''}$A:0{(' '+eos+':0') if self.add_eos_token else ''}"
168
+ pair = f"{single}{(' '+bos+':1') if self.add_bos_token else ''} $B:1{(' '+eos+':1') if self.add_eos_token else ''}"
169
+
170
+ special_tokens = []
171
+ if self.add_bos_token:
172
+ special_tokens.append((bos, bos_token_id))
173
+ if self.add_eos_token:
174
+ special_tokens.append((eos, eos_token_id))
175
+ self._tokenizer.post_processor = processors.TemplateProcessing(
176
+ single=single, pair=pair, special_tokens=special_tokens
177
+ )
178
+
179
+ @property
180
+ def add_eos_token(self):
181
+ return self._add_eos_token
182
+
183
+ @property
184
+ def add_bos_token(self):
185
+ return self._add_bos_token
186
+
187
+ @add_eos_token.setter
188
+ def add_eos_token(self, value):
189
+ self._add_eos_token = value
190
+ self.update_post_processor()
191
+
192
+ @add_bos_token.setter
193
+ def add_bos_token(self, value):
194
+ self._add_bos_token = value
195
+ self.update_post_processor()
196
+
197
+ def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
198
+ if not self.can_save_slow_tokenizer:
199
+ raise ValueError(
200
+ "Your fast tokenizer does not have the necessary information to save the vocabulary for a slow "
201
+ "tokenizer."
202
+ )
203
+
204
+ if not os.path.isdir(save_directory):
205
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
206
+ return
207
+ out_vocab_file = os.path.join(
208
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
209
+ )
210
+
211
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file):
212
+ copyfile(self.vocab_file, out_vocab_file)
213
+
214
+ return (out_vocab_file,)
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f868398fc4e05ee1e8aeba95ddf18ddcc45b8bce55d5093bead5bbf80429b48b
3
+ size 1477754
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/tokenizer_config.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "92538": {
30
+ "content": "<|plugin|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "92539": {
38
+ "content": "<|interpreter|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "92540": {
46
+ "content": "<|action_end|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "92541": {
54
+ "content": "<|action_start|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "92542": {
62
+ "content": "<|im_end|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "92543": {
70
+ "content": "<|im_start|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ }
77
+ },
78
+ "additional_special_tokens": [
79
+ "<|im_start|>",
80
+ "<|im_end|>",
81
+ "<|action_start|>",
82
+ "<|action_end|>",
83
+ "<|interpreter|>",
84
+ "<|plugin|>"
85
+ ],
86
+ "auto_map": {
87
+ "AutoTokenizer": [
88
+ "tokenization_internlm2.InternLM2Tokenizer",
89
+ "tokenization_internlm2_fast.InternLM2TokenizerFast"
90
+ ]
91
+ },
92
+ "bos_token": "<s>",
93
+ "chat_template": "{{ '<s>' }}{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + content + '<|im_end|>\n<|im_start|>assistant\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>\n' }}{% endif %}{% endfor %}",
94
+ "clean_up_tokenization_spaces": false,
95
+ "decode_with_prefix_space": false,
96
+ "eos_token": "</s>",
97
+ "model_max_length": 1000000000000000019884624838656,
98
+ "pad_token": "</s>",
99
+ "padding_side": "right",
100
+ "sp_model_kwargs": null,
101
+ "split_special_tokens": false,
102
+ "tokenizer_class": "InternLM2Tokenizer",
103
+ "unk_token": "<unk>"
104
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 6.0,
3
+ "total_flos": 2.9041541335076045e+18,
4
+ "train_loss": 0.28717788867652416,
5
+ "train_runtime": 47077.7992,
6
+ "train_samples_per_second": 2.868,
7
+ "train_steps_per_second": 0.011
8
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/trainer_log.jsonl CHANGED
@@ -19,3 +19,21 @@
19
  {"current_steps": 352, "total_steps": 528, "eval_loss": 0.2945823669433594, "epoch": 4.0, "percentage": 66.67, "elapsed_time": "8:41:50", "remaining_time": "4:20:55", "throughput": "0.00", "total_tokens": 0}
20
  {"current_steps": 360, "total_steps": 528, "loss": 0.0856, "learning_rate": 2.7817622282960815e-05, "epoch": 4.090909090909091, "percentage": 68.18, "elapsed_time": "8:53:17", "remaining_time": "4:08:52", "throughput": "0.00", "total_tokens": 0}
21
  {"current_steps": 370, "total_steps": 528, "loss": 0.0661, "learning_rate": 2.490459770759398e-05, "epoch": 4.204545454545454, "percentage": 70.08, "elapsed_time": "9:07:34", "remaining_time": "3:53:49", "throughput": "0.00", "total_tokens": 0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  {"current_steps": 352, "total_steps": 528, "eval_loss": 0.2945823669433594, "epoch": 4.0, "percentage": 66.67, "elapsed_time": "8:41:50", "remaining_time": "4:20:55", "throughput": "0.00", "total_tokens": 0}
20
  {"current_steps": 360, "total_steps": 528, "loss": 0.0856, "learning_rate": 2.7817622282960815e-05, "epoch": 4.090909090909091, "percentage": 68.18, "elapsed_time": "8:53:17", "remaining_time": "4:08:52", "throughput": "0.00", "total_tokens": 0}
21
  {"current_steps": 370, "total_steps": 528, "loss": 0.0661, "learning_rate": 2.490459770759398e-05, "epoch": 4.204545454545454, "percentage": 70.08, "elapsed_time": "9:07:34", "remaining_time": "3:53:49", "throughput": "0.00", "total_tokens": 0}
22
+ {"current_steps": 380, "total_steps": 528, "loss": 0.061, "learning_rate": 2.2101308941239203e-05, "epoch": 4.318181818181818, "percentage": 71.97, "elapsed_time": "9:21:58", "remaining_time": "3:38:52", "throughput": "0.00", "total_tokens": 0}
23
+ {"current_steps": 390, "total_steps": 528, "loss": 0.0744, "learning_rate": 1.942001405240979e-05, "epoch": 4.431818181818182, "percentage": 73.86, "elapsed_time": "9:36:17", "remaining_time": "3:23:55", "throughput": "0.00", "total_tokens": 0}
24
+ {"current_steps": 400, "total_steps": 528, "loss": 0.0736, "learning_rate": 1.6872437661432517e-05, "epoch": 4.545454545454545, "percentage": 75.76, "elapsed_time": "9:50:45", "remaining_time": "3:09:02", "throughput": "0.00", "total_tokens": 0}
25
+ {"current_steps": 410, "total_steps": 528, "loss": 0.0779, "learning_rate": 1.4469719671666043e-05, "epoch": 4.659090909090909, "percentage": 77.65, "elapsed_time": "10:05:19", "remaining_time": "2:54:12", "throughput": "0.00", "total_tokens": 0}
26
+ {"current_steps": 420, "total_steps": 528, "loss": 0.075, "learning_rate": 1.2222366557537911e-05, "epoch": 4.7727272727272725, "percentage": 79.55, "elapsed_time": "10:19:52", "remaining_time": "2:39:23", "throughput": "0.00", "total_tokens": 0}
27
+ {"current_steps": 430, "total_steps": 528, "loss": 0.0752, "learning_rate": 1.0140205422405214e-05, "epoch": 4.886363636363637, "percentage": 81.44, "elapsed_time": "10:34:26", "remaining_time": "2:24:35", "throughput": "0.00", "total_tokens": 0}
28
+ {"current_steps": 440, "total_steps": 528, "loss": 0.0684, "learning_rate": 8.232341027131885e-06, "epoch": 5.0, "percentage": 83.33, "elapsed_time": "10:48:47", "remaining_time": "2:09:45", "throughput": "0.00", "total_tokens": 0}
29
+ {"current_steps": 440, "total_steps": 528, "eval_loss": 0.369967520236969, "epoch": 5.0, "percentage": 83.33, "elapsed_time": "10:52:39", "remaining_time": "2:10:31", "throughput": "0.00", "total_tokens": 0}
30
+ {"current_steps": 450, "total_steps": 528, "loss": 0.0531, "learning_rate": 6.5071159772861436e-06, "epoch": 5.113636363636363, "percentage": 85.23, "elapsed_time": "11:07:14", "remaining_time": "1:55:39", "throughput": "0.00", "total_tokens": 0}
31
+ {"current_steps": 460, "total_steps": 528, "loss": 0.0437, "learning_rate": 4.972074243048897e-06, "epoch": 5.2272727272727275, "percentage": 87.12, "elapsed_time": "11:21:48", "remaining_time": "1:40:47", "throughput": "0.00", "total_tokens": 0}
32
+ {"current_steps": 470, "total_steps": 528, "loss": 0.0463, "learning_rate": 3.6339281713517303e-06, "epoch": 5.340909090909091, "percentage": 89.02, "elapsed_time": "11:36:22", "remaining_time": "1:25:56", "throughput": "0.00", "total_tokens": 0}
33
+ {"current_steps": 480, "total_steps": 528, "loss": 0.0485, "learning_rate": 2.4985291344915674e-06, "epoch": 5.454545454545454, "percentage": 90.91, "elapsed_time": "11:50:53", "remaining_time": "1:11:05", "throughput": "0.00", "total_tokens": 0}
34
+ {"current_steps": 490, "total_steps": 528, "loss": 0.0495, "learning_rate": 1.5708419435684462e-06, "epoch": 5.568181818181818, "percentage": 92.8, "elapsed_time": "12:05:26", "remaining_time": "0:56:15", "throughput": "0.00", "total_tokens": 0}
35
+ {"current_steps": 500, "total_steps": 528, "loss": 0.0484, "learning_rate": 8.549231386298151e-07, "epoch": 5.681818181818182, "percentage": 94.7, "elapsed_time": "12:20:01", "remaining_time": "0:41:26", "throughput": "0.00", "total_tokens": 0}
36
+ {"current_steps": 510, "total_steps": 528, "loss": 0.0384, "learning_rate": 3.5390325045304706e-07, "epoch": 5.795454545454545, "percentage": 96.59, "elapsed_time": "12:34:32", "remaining_time": "0:26:37", "throughput": "0.00", "total_tokens": 0}
37
+ {"current_steps": 520, "total_steps": 528, "loss": 0.0486, "learning_rate": 6.997311153086883e-08, "epoch": 5.909090909090909, "percentage": 98.48, "elapsed_time": "12:49:04", "remaining_time": "0:11:49", "throughput": "0.00", "total_tokens": 0}
38
+ {"current_steps": 528, "total_steps": 528, "eval_loss": 0.4368518590927124, "epoch": 6.0, "percentage": 100.0, "elapsed_time": "13:04:27", "remaining_time": "0:00:00", "throughput": "0.00", "total_tokens": 0}
39
+ {"current_steps": 528, "total_steps": 528, "epoch": 6.0, "percentage": 100.0, "elapsed_time": "13:04:28", "remaining_time": "0:00:00", "throughput": "0.00", "total_tokens": 0}
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/trainer_state.json ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 6.0,
5
+ "eval_steps": 88,
6
+ "global_step": 528,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.11363636363636363,
13
+ "grad_norm": 3.514838457107544,
14
+ "learning_rate": 1.8867924528301888e-05,
15
+ "loss": 6.943,
16
+ "step": 10
17
+ },
18
+ {
19
+ "epoch": 0.22727272727272727,
20
+ "grad_norm": 1.0595427751541138,
21
+ "learning_rate": 3.7735849056603776e-05,
22
+ "loss": 0.446,
23
+ "step": 20
24
+ },
25
+ {
26
+ "epoch": 0.3409090909090909,
27
+ "grad_norm": 0.6256385445594788,
28
+ "learning_rate": 5.660377358490566e-05,
29
+ "loss": 0.3515,
30
+ "step": 30
31
+ },
32
+ {
33
+ "epoch": 0.45454545454545453,
34
+ "grad_norm": 0.633573055267334,
35
+ "learning_rate": 7.547169811320755e-05,
36
+ "loss": 0.288,
37
+ "step": 40
38
+ },
39
+ {
40
+ "epoch": 0.5681818181818182,
41
+ "grad_norm": 0.4915701746940613,
42
+ "learning_rate": 9.433962264150944e-05,
43
+ "loss": 0.2819,
44
+ "step": 50
45
+ },
46
+ {
47
+ "epoch": 0.6818181818181818,
48
+ "grad_norm": 0.40083640813827515,
49
+ "learning_rate": 9.994642390694308e-05,
50
+ "loss": 0.2765,
51
+ "step": 60
52
+ },
53
+ {
54
+ "epoch": 0.7954545454545454,
55
+ "grad_norm": 0.7176418304443359,
56
+ "learning_rate": 9.968428675226714e-05,
57
+ "loss": 0.2754,
58
+ "step": 70
59
+ },
60
+ {
61
+ "epoch": 0.9090909090909091,
62
+ "grad_norm": 0.6853049397468567,
63
+ "learning_rate": 9.92048928531717e-05,
64
+ "loss": 0.277,
65
+ "step": 80
66
+ },
67
+ {
68
+ "epoch": 1.0,
69
+ "eval_accuracy": 0.9030666666666668,
70
+ "eval_loss": 0.26003387570381165,
71
+ "eval_runtime": 231.9406,
72
+ "eval_samples_per_second": 10.779,
73
+ "eval_steps_per_second": 10.779,
74
+ "step": 88
75
+ },
76
+ {
77
+ "epoch": 1.0227272727272727,
78
+ "grad_norm": 0.4268323481082916,
79
+ "learning_rate": 9.851033847720166e-05,
80
+ "loss": 0.2619,
81
+ "step": 90
82
+ },
83
+ {
84
+ "epoch": 1.1363636363636362,
85
+ "grad_norm": 0.9503114819526672,
86
+ "learning_rate": 9.760366073392246e-05,
87
+ "loss": 0.2385,
88
+ "step": 100
89
+ },
90
+ {
91
+ "epoch": 1.25,
92
+ "grad_norm": 0.3606574237346649,
93
+ "learning_rate": 9.648882429441257e-05,
94
+ "loss": 0.2341,
95
+ "step": 110
96
+ },
97
+ {
98
+ "epoch": 1.3636363636363638,
99
+ "grad_norm": 0.7226484417915344,
100
+ "learning_rate": 9.517070405476575e-05,
101
+ "loss": 0.2447,
102
+ "step": 120
103
+ },
104
+ {
105
+ "epoch": 1.4772727272727273,
106
+ "grad_norm": 0.8543397188186646,
107
+ "learning_rate": 9.365506381941066e-05,
108
+ "loss": 0.2441,
109
+ "step": 130
110
+ },
111
+ {
112
+ "epoch": 1.5909090909090908,
113
+ "grad_norm": 0.800394594669342,
114
+ "learning_rate": 9.194853109746074e-05,
115
+ "loss": 0.2379,
116
+ "step": 140
117
+ },
118
+ {
119
+ "epoch": 1.7045454545454546,
120
+ "grad_norm": 0.5756838321685791,
121
+ "learning_rate": 9.005856812230304e-05,
122
+ "loss": 0.2434,
123
+ "step": 150
124
+ },
125
+ {
126
+ "epoch": 1.8181818181818183,
127
+ "grad_norm": 1.0771032571792603,
128
+ "learning_rate": 8.799343922115044e-05,
129
+ "loss": 0.2352,
130
+ "step": 160
131
+ },
132
+ {
133
+ "epoch": 1.9318181818181817,
134
+ "grad_norm": 0.4805872440338135,
135
+ "learning_rate": 8.576217467724128e-05,
136
+ "loss": 0.2427,
137
+ "step": 170
138
+ },
139
+ {
140
+ "epoch": 2.0,
141
+ "eval_accuracy": 0.9006,
142
+ "eval_loss": 0.25738978385925293,
143
+ "eval_runtime": 231.2131,
144
+ "eval_samples_per_second": 10.813,
145
+ "eval_steps_per_second": 10.813,
146
+ "step": 176
147
+ },
148
+ {
149
+ "epoch": 2.0454545454545454,
150
+ "grad_norm": 0.5219587683677673,
151
+ "learning_rate": 8.337453124270863e-05,
152
+ "loss": 0.22,
153
+ "step": 180
154
+ },
155
+ {
156
+ "epoch": 2.159090909090909,
157
+ "grad_norm": 0.6363154053688049,
158
+ "learning_rate": 8.084094947478556e-05,
159
+ "loss": 0.1787,
160
+ "step": 190
161
+ },
162
+ {
163
+ "epoch": 2.2727272727272725,
164
+ "grad_norm": 0.6807820796966553,
165
+ "learning_rate": 7.817250808190483e-05,
166
+ "loss": 0.1647,
167
+ "step": 200
168
+ },
169
+ {
170
+ "epoch": 2.3863636363636362,
171
+ "grad_norm": 0.5443515777587891,
172
+ "learning_rate": 7.538087547932585e-05,
173
+ "loss": 0.1828,
174
+ "step": 210
175
+ },
176
+ {
177
+ "epoch": 2.5,
178
+ "grad_norm": 0.4641902446746826,
179
+ "learning_rate": 7.247825876612353e-05,
180
+ "loss": 0.1782,
181
+ "step": 220
182
+ },
183
+ {
184
+ "epoch": 2.6136363636363638,
185
+ "grad_norm": 0.5865933299064636,
186
+ "learning_rate": 6.947735034665002e-05,
187
+ "loss": 0.1942,
188
+ "step": 230
189
+ },
190
+ {
191
+ "epoch": 2.7272727272727275,
192
+ "grad_norm": 0.5332173705101013,
193
+ "learning_rate": 6.639127242987988e-05,
194
+ "loss": 0.1852,
195
+ "step": 240
196
+ },
197
+ {
198
+ "epoch": 2.840909090909091,
199
+ "grad_norm": 0.5550218820571899,
200
+ "learning_rate": 6.323351964932908e-05,
201
+ "loss": 0.1936,
202
+ "step": 250
203
+ },
204
+ {
205
+ "epoch": 2.9545454545454546,
206
+ "grad_norm": 0.6850063800811768,
207
+ "learning_rate": 6.001790005445607e-05,
208
+ "loss": 0.1813,
209
+ "step": 260
210
+ },
211
+ {
212
+ "epoch": 3.0,
213
+ "eval_accuracy": 0.9027,
214
+ "eval_loss": 0.2705931067466736,
215
+ "eval_runtime": 231.0113,
216
+ "eval_samples_per_second": 10.822,
217
+ "eval_steps_per_second": 10.822,
218
+ "step": 264
219
+ },
220
+ {
221
+ "epoch": 3.0681818181818183,
222
+ "grad_norm": 0.42733630537986755,
223
+ "learning_rate": 5.675847473157485e-05,
224
+ "loss": 0.14,
225
+ "step": 270
226
+ },
227
+ {
228
+ "epoch": 3.1818181818181817,
229
+ "grad_norm": 0.5972977876663208,
230
+ "learning_rate": 5.3469496318302204e-05,
231
+ "loss": 0.1197,
232
+ "step": 280
233
+ },
234
+ {
235
+ "epoch": 3.2954545454545454,
236
+ "grad_norm": 0.4995785653591156,
237
+ "learning_rate": 5.016534668039976e-05,
238
+ "loss": 0.1198,
239
+ "step": 290
240
+ },
241
+ {
242
+ "epoch": 3.409090909090909,
243
+ "grad_norm": 0.5500032305717468,
244
+ "learning_rate": 4.6860474023534335e-05,
245
+ "loss": 0.1131,
246
+ "step": 300
247
+ },
248
+ {
249
+ "epoch": 3.5227272727272725,
250
+ "grad_norm": 0.4452584683895111,
251
+ "learning_rate": 4.3569329714950704e-05,
252
+ "loss": 0.1185,
253
+ "step": 310
254
+ },
255
+ {
256
+ "epoch": 3.6363636363636362,
257
+ "grad_norm": 0.4754205346107483,
258
+ "learning_rate": 4.0306305091319595e-05,
259
+ "loss": 0.1197,
260
+ "step": 320
261
+ },
262
+ {
263
+ "epoch": 3.75,
264
+ "grad_norm": 0.6347799301147461,
265
+ "learning_rate": 3.7085668529084184e-05,
266
+ "loss": 0.122,
267
+ "step": 330
268
+ },
269
+ {
270
+ "epoch": 3.8636363636363638,
271
+ "grad_norm": 0.48911160230636597,
272
+ "learning_rate": 3.392150305248024e-05,
273
+ "loss": 0.1163,
274
+ "step": 340
275
+ },
276
+ {
277
+ "epoch": 3.9772727272727275,
278
+ "grad_norm": 0.6460514068603516,
279
+ "learning_rate": 3.082764475205442e-05,
280
+ "loss": 0.1263,
281
+ "step": 350
282
+ },
283
+ {
284
+ "epoch": 4.0,
285
+ "eval_accuracy": 0.8993666666666668,
286
+ "eval_loss": 0.2945823669433594,
287
+ "eval_runtime": 233.0443,
288
+ "eval_samples_per_second": 10.728,
289
+ "eval_steps_per_second": 10.728,
290
+ "step": 352
291
+ },
292
+ {
293
+ "epoch": 4.090909090909091,
294
+ "grad_norm": 0.37293320894241333,
295
+ "learning_rate": 2.7817622282960815e-05,
296
+ "loss": 0.0856,
297
+ "step": 360
298
+ },
299
+ {
300
+ "epoch": 4.204545454545454,
301
+ "grad_norm": 0.5676562190055847,
302
+ "learning_rate": 2.490459770759398e-05,
303
+ "loss": 0.0661,
304
+ "step": 370
305
+ },
306
+ {
307
+ "epoch": 4.318181818181818,
308
+ "grad_norm": 0.5680781006813049,
309
+ "learning_rate": 2.2101308941239203e-05,
310
+ "loss": 0.061,
311
+ "step": 380
312
+ },
313
+ {
314
+ "epoch": 4.431818181818182,
315
+ "grad_norm": 0.690169095993042,
316
+ "learning_rate": 1.942001405240979e-05,
317
+ "loss": 0.0744,
318
+ "step": 390
319
+ },
320
+ {
321
+ "epoch": 4.545454545454545,
322
+ "grad_norm": 0.5858839750289917,
323
+ "learning_rate": 1.6872437661432517e-05,
324
+ "loss": 0.0736,
325
+ "step": 400
326
+ },
327
+ {
328
+ "epoch": 4.659090909090909,
329
+ "grad_norm": 0.6473811268806458,
330
+ "learning_rate": 1.4469719671666043e-05,
331
+ "loss": 0.0779,
332
+ "step": 410
333
+ },
334
+ {
335
+ "epoch": 4.7727272727272725,
336
+ "grad_norm": 0.3694300055503845,
337
+ "learning_rate": 1.2222366557537911e-05,
338
+ "loss": 0.075,
339
+ "step": 420
340
+ },
341
+ {
342
+ "epoch": 4.886363636363637,
343
+ "grad_norm": 0.5935441851615906,
344
+ "learning_rate": 1.0140205422405214e-05,
345
+ "loss": 0.0752,
346
+ "step": 430
347
+ },
348
+ {
349
+ "epoch": 5.0,
350
+ "grad_norm": 0.7272607684135437,
351
+ "learning_rate": 8.232341027131885e-06,
352
+ "loss": 0.0684,
353
+ "step": 440
354
+ },
355
+ {
356
+ "epoch": 5.0,
357
+ "eval_accuracy": 0.8996666666666668,
358
+ "eval_loss": 0.369967520236969,
359
+ "eval_runtime": 232.4252,
360
+ "eval_samples_per_second": 10.756,
361
+ "eval_steps_per_second": 10.756,
362
+ "step": 440
363
+ },
364
+ {
365
+ "epoch": 5.113636363636363,
366
+ "grad_norm": 0.3855780363082886,
367
+ "learning_rate": 6.5071159772861436e-06,
368
+ "loss": 0.0531,
369
+ "step": 450
370
+ },
371
+ {
372
+ "epoch": 5.2272727272727275,
373
+ "grad_norm": 0.3242223560810089,
374
+ "learning_rate": 4.972074243048897e-06,
375
+ "loss": 0.0437,
376
+ "step": 460
377
+ },
378
+ {
379
+ "epoch": 5.340909090909091,
380
+ "grad_norm": 0.36955130100250244,
381
+ "learning_rate": 3.6339281713517303e-06,
382
+ "loss": 0.0463,
383
+ "step": 470
384
+ },
385
+ {
386
+ "epoch": 5.454545454545454,
387
+ "grad_norm": 0.3851165473461151,
388
+ "learning_rate": 2.4985291344915674e-06,
389
+ "loss": 0.0485,
390
+ "step": 480
391
+ },
392
+ {
393
+ "epoch": 5.568181818181818,
394
+ "grad_norm": 0.30520951747894287,
395
+ "learning_rate": 1.5708419435684462e-06,
396
+ "loss": 0.0495,
397
+ "step": 490
398
+ },
399
+ {
400
+ "epoch": 5.681818181818182,
401
+ "grad_norm": 0.8094011545181274,
402
+ "learning_rate": 8.549231386298151e-07,
403
+ "loss": 0.0484,
404
+ "step": 500
405
+ },
406
+ {
407
+ "epoch": 5.795454545454545,
408
+ "grad_norm": 0.21888971328735352,
409
+ "learning_rate": 3.5390325045304706e-07,
410
+ "loss": 0.0384,
411
+ "step": 510
412
+ },
413
+ {
414
+ "epoch": 5.909090909090909,
415
+ "grad_norm": 0.4017506539821625,
416
+ "learning_rate": 6.997311153086883e-08,
417
+ "loss": 0.0486,
418
+ "step": 520
419
+ },
420
+ {
421
+ "epoch": 6.0,
422
+ "eval_accuracy": 0.8984,
423
+ "eval_loss": 0.4368518590927124,
424
+ "eval_runtime": 232.9443,
425
+ "eval_samples_per_second": 10.732,
426
+ "eval_steps_per_second": 10.732,
427
+ "step": 528
428
+ },
429
+ {
430
+ "epoch": 6.0,
431
+ "step": 528,
432
+ "total_flos": 2.9041541335076045e+18,
433
+ "train_loss": 0.28717788867652416,
434
+ "train_runtime": 47077.7992,
435
+ "train_samples_per_second": 2.868,
436
+ "train_steps_per_second": 0.011
437
+ }
438
+ ],
439
+ "logging_steps": 10,
440
+ "max_steps": 528,
441
+ "num_input_tokens_seen": 0,
442
+ "num_train_epochs": 6,
443
+ "save_steps": 88,
444
+ "stateful_callbacks": {
445
+ "TrainerControl": {
446
+ "args": {
447
+ "should_epoch_stop": false,
448
+ "should_evaluate": false,
449
+ "should_log": false,
450
+ "should_save": true,
451
+ "should_training_stop": true
452
+ },
453
+ "attributes": {}
454
+ }
455
+ },
456
+ "total_flos": 2.9041541335076045e+18,
457
+ "train_batch_size": 32,
458
+ "trial_name": null,
459
+ "trial_params": null
460
+ }
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d5c2bfb768f1720511bef6e983b38242156f823ff83caba648f7520ad9d664c
3
+ size 5304
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_eval_accuracy.png ADDED
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_eval_loss.png ADDED
llama-factory/saves/internlm2_5_7b/lora/sft_bf16_p2_full/training_loss.png ADDED
results/l40_p2.txt ADDED
The diff for this file is too large to render. See raw diff