wangrongsheng commited on
Commit
5944a68
·
1 Parent(s): 320ce72
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. LLM-Detector-V5-11w/README.md +56 -0
  2. LLM-Detector-V5-11w/adapter_config.json +22 -0
  3. LLM-Detector-V5-11w/adapter_model.bin +3 -0
  4. LLM-Detector-V5-11w/all_results.json +7 -0
  5. LLM-Detector-V5-11w/checkpoint-12000/README.md +219 -0
  6. LLM-Detector-V5-11w/checkpoint-12000/adapter_config.json +22 -0
  7. LLM-Detector-V5-11w/checkpoint-12000/adapter_model.bin +3 -0
  8. LLM-Detector-V5-11w/checkpoint-12000/optimizer.pt +3 -0
  9. LLM-Detector-V5-11w/checkpoint-12000/qwen.tiktoken +0 -0
  10. LLM-Detector-V5-11w/checkpoint-12000/rng_state.pth +3 -0
  11. LLM-Detector-V5-11w/checkpoint-12000/scheduler.pt +3 -0
  12. LLM-Detector-V5-11w/checkpoint-12000/special_tokens_map.json +7 -0
  13. LLM-Detector-V5-11w/checkpoint-12000/tokenization_qwen.py +276 -0
  14. LLM-Detector-V5-11w/checkpoint-12000/tokenizer_config.json +13 -0
  15. LLM-Detector-V5-11w/checkpoint-12000/trainer_state.json +739 -0
  16. LLM-Detector-V5-11w/checkpoint-12000/training_args.bin +3 -0
  17. LLM-Detector-V5-11w/checkpoint-15000/README.md +219 -0
  18. LLM-Detector-V5-11w/checkpoint-15000/adapter_config.json +22 -0
  19. LLM-Detector-V5-11w/checkpoint-15000/adapter_model.bin +3 -0
  20. LLM-Detector-V5-11w/checkpoint-15000/optimizer.pt +3 -0
  21. LLM-Detector-V5-11w/checkpoint-15000/qwen.tiktoken +0 -0
  22. LLM-Detector-V5-11w/checkpoint-15000/rng_state.pth +3 -0
  23. LLM-Detector-V5-11w/checkpoint-15000/scheduler.pt +3 -0
  24. LLM-Detector-V5-11w/checkpoint-15000/special_tokens_map.json +7 -0
  25. LLM-Detector-V5-11w/checkpoint-15000/tokenization_qwen.py +276 -0
  26. LLM-Detector-V5-11w/checkpoint-15000/tokenizer_config.json +13 -0
  27. LLM-Detector-V5-11w/checkpoint-15000/trainer_state.json +919 -0
  28. LLM-Detector-V5-11w/checkpoint-15000/training_args.bin +3 -0
  29. LLM-Detector-V5-11w/checkpoint-18000/README.md +219 -0
  30. LLM-Detector-V5-11w/checkpoint-18000/adapter_config.json +22 -0
  31. LLM-Detector-V5-11w/checkpoint-18000/adapter_model.bin +3 -0
  32. LLM-Detector-V5-11w/checkpoint-18000/optimizer.pt +3 -0
  33. LLM-Detector-V5-11w/checkpoint-18000/qwen.tiktoken +0 -0
  34. LLM-Detector-V5-11w/checkpoint-18000/rng_state.pth +3 -0
  35. LLM-Detector-V5-11w/checkpoint-18000/scheduler.pt +3 -0
  36. LLM-Detector-V5-11w/checkpoint-18000/special_tokens_map.json +7 -0
  37. LLM-Detector-V5-11w/checkpoint-18000/tokenization_qwen.py +276 -0
  38. LLM-Detector-V5-11w/checkpoint-18000/tokenizer_config.json +13 -0
  39. LLM-Detector-V5-11w/checkpoint-18000/trainer_state.json +1099 -0
  40. LLM-Detector-V5-11w/checkpoint-18000/training_args.bin +3 -0
  41. LLM-Detector-V5-11w/checkpoint-21000/README.md +219 -0
  42. LLM-Detector-V5-11w/checkpoint-21000/adapter_config.json +22 -0
  43. LLM-Detector-V5-11w/checkpoint-21000/adapter_model.bin +3 -0
  44. LLM-Detector-V5-11w/checkpoint-21000/optimizer.pt +3 -0
  45. LLM-Detector-V5-11w/checkpoint-21000/qwen.tiktoken +0 -0
  46. LLM-Detector-V5-11w/checkpoint-21000/rng_state.pth +3 -0
  47. LLM-Detector-V5-11w/checkpoint-21000/scheduler.pt +3 -0
  48. LLM-Detector-V5-11w/checkpoint-21000/special_tokens_map.json +7 -0
  49. LLM-Detector-V5-11w/checkpoint-21000/tokenization_qwen.py +276 -0
  50. LLM-Detector-V5-11w/checkpoint-21000/tokenizer_config.json +13 -0
LLM-Detector-V5-11w/README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: ./Qwen-14B-Chat
4
+ tags:
5
+ - llama-factory
6
+ - lora
7
+ - generated_from_trainer
8
+ model-index:
9
+ - name: qwen-14b
10
+ results: []
11
+ ---
12
+
13
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
14
+ should probably proofread and complete it, then remove this comment. -->
15
+
16
+ # qwen-14b
17
+
18
+ This model is a fine-tuned version of [./Qwen-14B-Chat](https://huggingface.co/./Qwen-14B-Chat) on the ta, the tb, the tc, the td, the te, the tf, the tg and the th datasets.
19
+
20
+ ## Model description
21
+
22
+ More information needed
23
+
24
+ ## Intended uses & limitations
25
+
26
+ More information needed
27
+
28
+ ## Training and evaluation data
29
+
30
+ More information needed
31
+
32
+ ## Training procedure
33
+
34
+ ### Training hyperparameters
35
+
36
+ The following hyperparameters were used during training:
37
+ - learning_rate: 5e-05
38
+ - train_batch_size: 4
39
+ - eval_batch_size: 8
40
+ - seed: 42
41
+ - gradient_accumulation_steps: 4
42
+ - total_train_batch_size: 16
43
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
44
+ - lr_scheduler_type: cosine
45
+ - num_epochs: 3.0
46
+
47
+ ### Training results
48
+
49
+
50
+
51
+ ### Framework versions
52
+
53
+ - Transformers 4.33.0
54
+ - Pytorch 2.1.1+cu121
55
+ - Datasets 2.14.7
56
+ - Tokenizers 0.13.3
LLM-Detector-V5-11w/adapter_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "./Qwen-14B-Chat",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "lora_alpha": 16.0,
12
+ "lora_dropout": 0.1,
13
+ "modules_to_save": null,
14
+ "peft_type": "LORA",
15
+ "r": 8,
16
+ "rank_pattern": {},
17
+ "revision": null,
18
+ "target_modules": [
19
+ "c_attn"
20
+ ],
21
+ "task_type": "CAUSAL_LM"
22
+ }
LLM-Detector-V5-11w/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dde59642634b55ccc32fb6fa05297f77f206ce08fa02e68f91dea53f86214102
3
+ size 26243102
LLM-Detector-V5-11w/all_results.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "train_loss": 0.018557672745323963,
4
+ "train_runtime": 121687.4213,
5
+ "train_samples_per_second": 2.932,
6
+ "train_steps_per_second": 0.183
7
+ }
LLM-Detector-V5-11w/checkpoint-12000/README.md ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: ./Qwen-14B-Chat
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
+ - **Shared by [optional]:** [More Information Needed]
22
+ - **Model type:** [More Information Needed]
23
+ - **Language(s) (NLP):** [More Information Needed]
24
+ - **License:** [More Information Needed]
25
+ - **Finetuned from model [optional]:** [More Information Needed]
26
+
27
+ ### Model Sources [optional]
28
+
29
+ <!-- Provide the basic links for the model. -->
30
+
31
+ - **Repository:** [More Information Needed]
32
+ - **Paper [optional]:** [More Information Needed]
33
+ - **Demo [optional]:** [More Information Needed]
34
+
35
+ ## Uses
36
+
37
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
38
+
39
+ ### Direct Use
40
+
41
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
42
+
43
+ [More Information Needed]
44
+
45
+ ### Downstream Use [optional]
46
+
47
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Out-of-Scope Use
52
+
53
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
54
+
55
+ [More Information Needed]
56
+
57
+ ## Bias, Risks, and Limitations
58
+
59
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ### Recommendations
64
+
65
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
66
+
67
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
68
+
69
+ ## How to Get Started with the Model
70
+
71
+ Use the code below to get started with the model.
72
+
73
+ [More Information Needed]
74
+
75
+ ## Training Details
76
+
77
+ ### Training Data
78
+
79
+ <!-- This should link to a Data 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. -->
80
+
81
+ [More Information Needed]
82
+
83
+ ### Training Procedure
84
+
85
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
86
+
87
+ #### Preprocessing [optional]
88
+
89
+ [More Information Needed]
90
+
91
+
92
+ #### Training Hyperparameters
93
+
94
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
95
+
96
+ #### Speeds, Sizes, Times [optional]
97
+
98
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
99
+
100
+ [More Information Needed]
101
+
102
+ ## Evaluation
103
+
104
+ <!-- This section describes the evaluation protocols and provides the results. -->
105
+
106
+ ### Testing Data, Factors & Metrics
107
+
108
+ #### Testing Data
109
+
110
+ <!-- This should link to a Data Card if possible. -->
111
+
112
+ [More Information Needed]
113
+
114
+ #### Factors
115
+
116
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Metrics
121
+
122
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
123
+
124
+ [More Information Needed]
125
+
126
+ ### Results
127
+
128
+ [More Information Needed]
129
+
130
+ #### Summary
131
+
132
+
133
+
134
+ ## Model Examination [optional]
135
+
136
+ <!-- Relevant interpretability work for the model goes here -->
137
+
138
+ [More Information Needed]
139
+
140
+ ## Environmental Impact
141
+
142
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
143
+
144
+ 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).
145
+
146
+ - **Hardware Type:** [More Information Needed]
147
+ - **Hours used:** [More Information Needed]
148
+ - **Cloud Provider:** [More Information Needed]
149
+ - **Compute Region:** [More Information Needed]
150
+ - **Carbon Emitted:** [More Information Needed]
151
+
152
+ ## Technical Specifications [optional]
153
+
154
+ ### Model Architecture and Objective
155
+
156
+ [More Information Needed]
157
+
158
+ ### Compute Infrastructure
159
+
160
+ [More Information Needed]
161
+
162
+ #### Hardware
163
+
164
+ [More Information Needed]
165
+
166
+ #### Software
167
+
168
+ [More Information Needed]
169
+
170
+ ## Citation [optional]
171
+
172
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
173
+
174
+ **BibTeX:**
175
+
176
+ [More Information Needed]
177
+
178
+ **APA:**
179
+
180
+ [More Information Needed]
181
+
182
+ ## Glossary [optional]
183
+
184
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
185
+
186
+ [More Information Needed]
187
+
188
+ ## More Information [optional]
189
+
190
+ [More Information Needed]
191
+
192
+ ## Model Card Authors [optional]
193
+
194
+ [More Information Needed]
195
+
196
+ ## Model Card Contact
197
+
198
+ [More Information Needed]
199
+
200
+
201
+ ## Training procedure
202
+
203
+
204
+ The following `bitsandbytes` quantization config was used during training:
205
+ - quant_method: QuantizationMethod.BITS_AND_BYTES
206
+ - load_in_8bit: False
207
+ - load_in_4bit: True
208
+ - llm_int8_threshold: 6.0
209
+ - llm_int8_skip_modules: None
210
+ - llm_int8_enable_fp32_cpu_offload: False
211
+ - llm_int8_has_fp16_weight: False
212
+ - bnb_4bit_quant_type: nf4
213
+ - bnb_4bit_use_double_quant: True
214
+ - bnb_4bit_compute_dtype: float16
215
+
216
+ ### Framework versions
217
+
218
+
219
+ - PEFT 0.6.2
LLM-Detector-V5-11w/checkpoint-12000/adapter_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "./Qwen-14B-Chat",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "lora_alpha": 16.0,
12
+ "lora_dropout": 0.1,
13
+ "modules_to_save": null,
14
+ "peft_type": "LORA",
15
+ "r": 8,
16
+ "rank_pattern": {},
17
+ "revision": null,
18
+ "target_modules": [
19
+ "c_attn"
20
+ ],
21
+ "task_type": "CAUSAL_LM"
22
+ }
LLM-Detector-V5-11w/checkpoint-12000/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be4e56d160cf7490138ad2318e65a682c847563f5905bfc743a291b2b35caa7b
3
+ size 26243102
LLM-Detector-V5-11w/checkpoint-12000/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b33c417ba7224c09cfc45a2f433ce271e77b9f3643be2b792ba5258b20cd9662
3
+ size 52496442
LLM-Detector-V5-11w/checkpoint-12000/qwen.tiktoken ADDED
The diff for this file is too large to render. See raw diff
 
LLM-Detector-V5-11w/checkpoint-12000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:210d36a326ab9ae3f9794cdb713f70f85060cd21ff6d38241d3c5871436a7529
3
+ size 14244
LLM-Detector-V5-11w/checkpoint-12000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67f15ee785078ff296bbc591ab3e9dfc50cf8cddc42a477dfe677cda389ba0dd
3
+ size 1064
LLM-Detector-V5-11w/checkpoint-12000/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_end|>"
4
+ ],
5
+ "eos_token": "<|endoftext|>",
6
+ "pad_token": "<|endoftext|>"
7
+ }
LLM-Detector-V5-11w/checkpoint-12000/tokenization_qwen.py ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Alibaba Cloud.
2
+ #
3
+ # This source code is licensed under the license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ """Tokenization classes for QWen."""
7
+
8
+ import base64
9
+ import logging
10
+ import os
11
+ import unicodedata
12
+ from typing import Collection, Dict, List, Set, Tuple, Union
13
+
14
+ import tiktoken
15
+ from transformers import PreTrainedTokenizer, AddedToken
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ VOCAB_FILES_NAMES = {"vocab_file": "qwen.tiktoken"}
21
+
22
+ PAT_STR = r"""(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}| ?[^\s\p{L}\p{N}]+[\r\n]*|\s*[\r\n]+|\s+(?!\S)|\s+"""
23
+ ENDOFTEXT = "<|endoftext|>"
24
+ IMSTART = "<|im_start|>"
25
+ IMEND = "<|im_end|>"
26
+ # as the default behavior is changed to allow special tokens in
27
+ # regular texts, the surface forms of special tokens need to be
28
+ # as different as possible to minimize the impact
29
+ EXTRAS = tuple((f"<|extra_{i}|>" for i in range(205)))
30
+ # changed to use actual index to avoid misconfiguration with vocabulary expansion
31
+ SPECIAL_START_ID = 151643
32
+ SPECIAL_TOKENS = tuple(
33
+ enumerate(
34
+ (
35
+ (
36
+ ENDOFTEXT,
37
+ IMSTART,
38
+ IMEND,
39
+ )
40
+ + EXTRAS
41
+ ),
42
+ start=SPECIAL_START_ID,
43
+ )
44
+ )
45
+ SPECIAL_TOKENS_SET = set(t for i, t in SPECIAL_TOKENS)
46
+
47
+
48
+ def _load_tiktoken_bpe(tiktoken_bpe_file: str) -> Dict[bytes, int]:
49
+ with open(tiktoken_bpe_file, "rb") as f:
50
+ contents = f.read()
51
+ return {
52
+ base64.b64decode(token): int(rank)
53
+ for token, rank in (line.split() for line in contents.splitlines() if line)
54
+ }
55
+
56
+
57
+ class QWenTokenizer(PreTrainedTokenizer):
58
+ """QWen tokenizer."""
59
+
60
+ vocab_files_names = VOCAB_FILES_NAMES
61
+
62
+ def __init__(
63
+ self,
64
+ vocab_file,
65
+ errors="replace",
66
+ extra_vocab_file=None,
67
+ **kwargs,
68
+ ):
69
+ super().__init__(**kwargs)
70
+
71
+ # how to handle errors in decoding UTF-8 byte sequences
72
+ # use ignore if you are in streaming inference
73
+ self.errors = errors
74
+
75
+ self.mergeable_ranks = _load_tiktoken_bpe(vocab_file) # type: Dict[bytes, int]
76
+ self.special_tokens = {
77
+ token: index
78
+ for index, token in SPECIAL_TOKENS
79
+ }
80
+
81
+ # try load extra vocab from file
82
+ if extra_vocab_file is not None:
83
+ used_ids = set(self.mergeable_ranks.values()) | set(self.special_tokens.values())
84
+ extra_mergeable_ranks = _load_tiktoken_bpe(extra_vocab_file)
85
+ for token, index in extra_mergeable_ranks.items():
86
+ if token in self.mergeable_ranks:
87
+ logger.info(f"extra token {token} exists, skipping")
88
+ continue
89
+ if index in used_ids:
90
+ logger.info(f'the index {index} for extra token {token} exists, skipping')
91
+ continue
92
+ self.mergeable_ranks[token] = index
93
+ # the index may be sparse after this, but don't worry tiktoken.Encoding will handle this
94
+
95
+ enc = tiktoken.Encoding(
96
+ "Qwen",
97
+ pat_str=PAT_STR,
98
+ mergeable_ranks=self.mergeable_ranks,
99
+ special_tokens=self.special_tokens,
100
+ )
101
+ assert (
102
+ len(self.mergeable_ranks) + len(self.special_tokens) == enc.n_vocab
103
+ ), f"{len(self.mergeable_ranks) + len(self.special_tokens)} != {enc.n_vocab} in encoding"
104
+
105
+ self.decoder = {
106
+ v: k for k, v in self.mergeable_ranks.items()
107
+ } # type: dict[int, bytes|str]
108
+ self.decoder.update({v: k for k, v in self.special_tokens.items()})
109
+
110
+ self.tokenizer = enc # type: tiktoken.Encoding
111
+
112
+ self.eod_id = self.tokenizer.eot_token
113
+ self.im_start_id = self.special_tokens[IMSTART]
114
+ self.im_end_id = self.special_tokens[IMEND]
115
+
116
+ def __getstate__(self):
117
+ # for pickle lovers
118
+ state = self.__dict__.copy()
119
+ del state["tokenizer"]
120
+ return state
121
+
122
+ def __setstate__(self, state):
123
+ # tokenizer is not python native; don't pass it; rebuild it
124
+ self.__dict__.update(state)
125
+ enc = tiktoken.Encoding(
126
+ "Qwen",
127
+ pat_str=PAT_STR,
128
+ mergeable_ranks=self.mergeable_ranks,
129
+ special_tokens=self.special_tokens,
130
+ )
131
+ self.tokenizer = enc
132
+
133
+ def __len__(self) -> int:
134
+ return self.tokenizer.n_vocab
135
+
136
+ def get_vocab(self) -> Dict[bytes, int]:
137
+ return self.mergeable_ranks
138
+
139
+ def convert_tokens_to_ids(
140
+ self, tokens: Union[bytes, str, List[Union[bytes, str]]]
141
+ ) -> List[int]:
142
+ ids = []
143
+ if isinstance(tokens, (str, bytes)):
144
+ if tokens in self.special_tokens:
145
+ return self.special_tokens[tokens]
146
+ else:
147
+ return self.mergeable_ranks.get(tokens)
148
+ for token in tokens:
149
+ if token in self.special_tokens:
150
+ ids.append(self.special_tokens[token])
151
+ else:
152
+ ids.append(self.mergeable_ranks.get(token))
153
+ return ids
154
+
155
+ def _add_tokens(
156
+ self,
157
+ new_tokens: Union[List[str], List[AddedToken]],
158
+ special_tokens: bool = False,
159
+ ) -> int:
160
+ if not special_tokens and new_tokens:
161
+ raise ValueError("Adding regular tokens is not supported")
162
+ for token in new_tokens:
163
+ surface_form = token.content if isinstance(token, AddedToken) else token
164
+ if surface_form not in SPECIAL_TOKENS_SET:
165
+ raise ValueError("Adding unknown special tokens is not supported")
166
+ return 0
167
+
168
+ def save_vocabulary(self, save_directory: str, **kwargs) -> Tuple[str]:
169
+ """
170
+ Save only the vocabulary of the tokenizer (vocabulary).
171
+
172
+ Returns:
173
+ `Tuple(str)`: Paths to the files saved.
174
+ """
175
+ file_path = os.path.join(save_directory, "qwen.tiktoken")
176
+ with open(file_path, "w", encoding="utf8") as w:
177
+ for k, v in self.mergeable_ranks.items():
178
+ line = base64.b64encode(k).decode("utf8") + " " + str(v) + "\n"
179
+ w.write(line)
180
+ return (file_path,)
181
+
182
+ def tokenize(
183
+ self,
184
+ text: str,
185
+ allowed_special: Union[Set, str] = "all",
186
+ disallowed_special: Union[Collection, str] = (),
187
+ **kwargs,
188
+ ) -> List[Union[bytes, str]]:
189
+ """
190
+ Converts a string in a sequence of tokens.
191
+
192
+ Args:
193
+ text (`str`):
194
+ The sequence to be encoded.
195
+ allowed_special (`Literal["all"]` or `set`):
196
+ The surface forms of the tokens to be encoded as special tokens in regular texts.
197
+ Default to "all".
198
+ disallowed_special (`Literal["all"]` or `Collection`):
199
+ The surface forms of the tokens that should not be in regular texts and trigger errors.
200
+ Default to an empty tuple.
201
+
202
+ kwargs (additional keyword arguments, *optional*):
203
+ Will be passed to the underlying model specific encode method.
204
+
205
+ Returns:
206
+ `List[bytes|str]`: The list of tokens.
207
+ """
208
+ tokens = []
209
+ text = unicodedata.normalize("NFC", text)
210
+
211
+ # this implementation takes a detour: text -> token id -> token surface forms
212
+ for t in self.tokenizer.encode(
213
+ text, allowed_special=allowed_special, disallowed_special=disallowed_special
214
+ ):
215
+ tokens.append(self.decoder[t])
216
+ return tokens
217
+
218
+ def convert_tokens_to_string(self, tokens: List[Union[bytes, str]]) -> str:
219
+ """
220
+ Converts a sequence of tokens in a single string.
221
+ """
222
+ text = ""
223
+ temp = b""
224
+ for t in tokens:
225
+ if isinstance(t, str):
226
+ if temp:
227
+ text += temp.decode("utf-8", errors=self.errors)
228
+ temp = b""
229
+ text += t
230
+ elif isinstance(t, bytes):
231
+ temp += t
232
+ else:
233
+ raise TypeError("token should only be of type types or str")
234
+ if temp:
235
+ text += temp.decode("utf-8", errors=self.errors)
236
+ return text
237
+
238
+ @property
239
+ def vocab_size(self):
240
+ return self.tokenizer.n_vocab
241
+
242
+ def _convert_id_to_token(self, index: int) -> Union[bytes, str]:
243
+ """Converts an id to a token, special tokens included"""
244
+ if index in self.decoder:
245
+ return self.decoder[index]
246
+ raise ValueError("unknown ids")
247
+
248
+ def _convert_token_to_id(self, token: Union[bytes, str]) -> int:
249
+ """Converts a token to an id using the vocab, special tokens included"""
250
+ if token in self.special_tokens:
251
+ return self.special_tokens[token]
252
+ if token in self.mergeable_ranks:
253
+ return self.mergeable_ranks[token]
254
+ raise ValueError("unknown token")
255
+
256
+ def _tokenize(self, text: str, **kwargs):
257
+ """
258
+ Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based
259
+ vocabulary or sub-words for sub-word-based vocabularies (BPE/SentencePieces/WordPieces).
260
+
261
+ Do NOT take care of added tokens.
262
+ """
263
+ raise NotImplementedError
264
+
265
+ def _decode(
266
+ self,
267
+ token_ids: Union[int, List[int]],
268
+ skip_special_tokens: bool = False,
269
+ errors: str = None,
270
+ **kwargs,
271
+ ) -> str:
272
+ if isinstance(token_ids, int):
273
+ token_ids = [token_ids]
274
+ if skip_special_tokens:
275
+ token_ids = [i for i in token_ids if i < self.eod_id]
276
+ return self.tokenizer.decode(token_ids, errors=errors or self.errors)
LLM-Detector-V5-11w/checkpoint-12000/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoTokenizer": [
4
+ "tokenization_qwen.QWenTokenizer",
5
+ null
6
+ ]
7
+ },
8
+ "clean_up_tokenization_spaces": true,
9
+ "model_max_length": 8192,
10
+ "padding_side": "right",
11
+ "split_special_tokens": false,
12
+ "tokenizer_class": "QWenTokenizer"
13
+ }
LLM-Detector-V5-11w/checkpoint-12000/trainer_state.json ADDED
@@ -0,0 +1,739 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 1.6144764723689078,
5
+ "eval_steps": 500,
6
+ "global_step": 12000,
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.01,
13
+ "learning_rate": 4.9997567688496474e-05,
14
+ "loss": 2.8699,
15
+ "step": 100
16
+ },
17
+ {
18
+ "epoch": 0.03,
19
+ "learning_rate": 4.9990172715142793e-05,
20
+ "loss": 0.0389,
21
+ "step": 200
22
+ },
23
+ {
24
+ "epoch": 0.04,
25
+ "learning_rate": 4.997781629993153e-05,
26
+ "loss": 0.0301,
27
+ "step": 300
28
+ },
29
+ {
30
+ "epoch": 0.05,
31
+ "learning_rate": 4.9960500896052476e-05,
32
+ "loss": 0.0244,
33
+ "step": 400
34
+ },
35
+ {
36
+ "epoch": 0.07,
37
+ "learning_rate": 4.993822994123172e-05,
38
+ "loss": 0.0151,
39
+ "step": 500
40
+ },
41
+ {
42
+ "epoch": 0.08,
43
+ "learning_rate": 4.9911007857049264e-05,
44
+ "loss": 0.012,
45
+ "step": 600
46
+ },
47
+ {
48
+ "epoch": 0.09,
49
+ "learning_rate": 4.987884004806111e-05,
50
+ "loss": 0.0268,
51
+ "step": 700
52
+ },
53
+ {
54
+ "epoch": 0.11,
55
+ "learning_rate": 4.984173290072626e-05,
56
+ "loss": 0.0187,
57
+ "step": 800
58
+ },
59
+ {
60
+ "epoch": 0.12,
61
+ "learning_rate": 4.979969378213884e-05,
62
+ "loss": 0.0166,
63
+ "step": 900
64
+ },
65
+ {
66
+ "epoch": 0.13,
67
+ "learning_rate": 4.975273103856537e-05,
68
+ "loss": 0.022,
69
+ "step": 1000
70
+ },
71
+ {
72
+ "epoch": 0.15,
73
+ "learning_rate": 4.970085399378785e-05,
74
+ "loss": 0.0194,
75
+ "step": 1100
76
+ },
77
+ {
78
+ "epoch": 0.16,
79
+ "learning_rate": 4.964407294725254e-05,
80
+ "loss": 0.0182,
81
+ "step": 1200
82
+ },
83
+ {
84
+ "epoch": 0.17,
85
+ "learning_rate": 4.958239917202523e-05,
86
+ "loss": 0.0204,
87
+ "step": 1300
88
+ },
89
+ {
90
+ "epoch": 0.19,
91
+ "learning_rate": 4.9515844912553106e-05,
92
+ "loss": 0.013,
93
+ "step": 1400
94
+ },
95
+ {
96
+ "epoch": 0.2,
97
+ "learning_rate": 4.944442338223378e-05,
98
+ "loss": 0.0107,
99
+ "step": 1500
100
+ },
101
+ {
102
+ "epoch": 0.22,
103
+ "learning_rate": 4.9368148760792e-05,
104
+ "loss": 0.0156,
105
+ "step": 1600
106
+ },
107
+ {
108
+ "epoch": 0.23,
109
+ "learning_rate": 4.9287036191464414e-05,
110
+ "loss": 0.0141,
111
+ "step": 1700
112
+ },
113
+ {
114
+ "epoch": 0.24,
115
+ "learning_rate": 4.9201101777993116e-05,
116
+ "loss": 0.0104,
117
+ "step": 1800
118
+ },
119
+ {
120
+ "epoch": 0.26,
121
+ "learning_rate": 4.911036258142853e-05,
122
+ "loss": 0.0087,
123
+ "step": 1900
124
+ },
125
+ {
126
+ "epoch": 0.27,
127
+ "learning_rate": 4.9014836616742065e-05,
128
+ "loss": 0.013,
129
+ "step": 2000
130
+ },
131
+ {
132
+ "epoch": 0.28,
133
+ "learning_rate": 4.891454284924965e-05,
134
+ "loss": 0.0194,
135
+ "step": 2100
136
+ },
137
+ {
138
+ "epoch": 0.3,
139
+ "learning_rate": 4.8809501190846284e-05,
140
+ "loss": 0.0131,
141
+ "step": 2200
142
+ },
143
+ {
144
+ "epoch": 0.31,
145
+ "learning_rate": 4.8699732496052965e-05,
146
+ "loss": 0.0135,
147
+ "step": 2300
148
+ },
149
+ {
150
+ "epoch": 0.32,
151
+ "learning_rate": 4.858525855787619e-05,
152
+ "loss": 0.0106,
153
+ "step": 2400
154
+ },
155
+ {
156
+ "epoch": 0.34,
157
+ "learning_rate": 4.846610210348137e-05,
158
+ "loss": 0.0089,
159
+ "step": 2500
160
+ },
161
+ {
162
+ "epoch": 0.35,
163
+ "learning_rate": 4.8342286789680605e-05,
164
+ "loss": 0.0086,
165
+ "step": 2600
166
+ },
167
+ {
168
+ "epoch": 0.36,
169
+ "learning_rate": 4.8213837198235996e-05,
170
+ "loss": 0.0035,
171
+ "step": 2700
172
+ },
173
+ {
174
+ "epoch": 0.38,
175
+ "learning_rate": 4.8080778830979276e-05,
176
+ "loss": 0.0121,
177
+ "step": 2800
178
+ },
179
+ {
180
+ "epoch": 0.39,
181
+ "learning_rate": 4.794313810474878e-05,
182
+ "loss": 0.0146,
183
+ "step": 2900
184
+ },
185
+ {
186
+ "epoch": 0.4,
187
+ "learning_rate": 4.780094234614479e-05,
188
+ "loss": 0.0047,
189
+ "step": 3000
190
+ },
191
+ {
192
+ "epoch": 0.42,
193
+ "learning_rate": 4.765421978610418e-05,
194
+ "loss": 0.0096,
195
+ "step": 3100
196
+ },
197
+ {
198
+ "epoch": 0.43,
199
+ "learning_rate": 4.750299955429562e-05,
200
+ "loss": 0.0116,
201
+ "step": 3200
202
+ },
203
+ {
204
+ "epoch": 0.44,
205
+ "learning_rate": 4.734731167333625e-05,
206
+ "loss": 0.0192,
207
+ "step": 3300
208
+ },
209
+ {
210
+ "epoch": 0.46,
211
+ "learning_rate": 4.718718705283113e-05,
212
+ "loss": 0.0111,
213
+ "step": 3400
214
+ },
215
+ {
216
+ "epoch": 0.47,
217
+ "learning_rate": 4.702265748323661e-05,
218
+ "loss": 0.0114,
219
+ "step": 3500
220
+ },
221
+ {
222
+ "epoch": 0.48,
223
+ "learning_rate": 4.685375562954876e-05,
224
+ "loss": 0.0113,
225
+ "step": 3600
226
+ },
227
+ {
228
+ "epoch": 0.5,
229
+ "learning_rate": 4.668051502481818e-05,
230
+ "loss": 0.0097,
231
+ "step": 3700
232
+ },
233
+ {
234
+ "epoch": 0.51,
235
+ "learning_rate": 4.650297006349257e-05,
236
+ "loss": 0.0094,
237
+ "step": 3800
238
+ },
239
+ {
240
+ "epoch": 0.52,
241
+ "learning_rate": 4.63211559945881e-05,
242
+ "loss": 0.0059,
243
+ "step": 3900
244
+ },
245
+ {
246
+ "epoch": 0.54,
247
+ "learning_rate": 4.613699021830524e-05,
248
+ "loss": 0.0195,
249
+ "step": 4000
250
+ },
251
+ {
252
+ "epoch": 0.55,
253
+ "learning_rate": 4.59467888395669e-05,
254
+ "loss": 0.0088,
255
+ "step": 4100
256
+ },
257
+ {
258
+ "epoch": 0.57,
259
+ "learning_rate": 4.575242877508777e-05,
260
+ "loss": 0.0087,
261
+ "step": 4200
262
+ },
263
+ {
264
+ "epoch": 0.58,
265
+ "learning_rate": 4.5553948612282607e-05,
266
+ "loss": 0.0088,
267
+ "step": 4300
268
+ },
269
+ {
270
+ "epoch": 0.59,
271
+ "learning_rate": 4.5351387756552846e-05,
272
+ "loss": 0.0122,
273
+ "step": 4400
274
+ },
275
+ {
276
+ "epoch": 0.61,
277
+ "learning_rate": 4.51447864234632e-05,
278
+ "loss": 0.0081,
279
+ "step": 4500
280
+ },
281
+ {
282
+ "epoch": 0.62,
283
+ "learning_rate": 4.4934185630757484e-05,
284
+ "loss": 0.0079,
285
+ "step": 4600
286
+ },
287
+ {
288
+ "epoch": 0.63,
289
+ "learning_rate": 4.4719627190215064e-05,
290
+ "loss": 0.011,
291
+ "step": 4700
292
+ },
293
+ {
294
+ "epoch": 0.65,
295
+ "learning_rate": 4.450115369934976e-05,
296
+ "loss": 0.0146,
297
+ "step": 4800
298
+ },
299
+ {
300
+ "epoch": 0.66,
301
+ "learning_rate": 4.427880853295274e-05,
302
+ "loss": 0.0057,
303
+ "step": 4900
304
+ },
305
+ {
306
+ "epoch": 0.67,
307
+ "learning_rate": 4.4052635834481025e-05,
308
+ "loss": 0.0051,
309
+ "step": 5000
310
+ },
311
+ {
312
+ "epoch": 0.69,
313
+ "learning_rate": 4.3822680507293455e-05,
314
+ "loss": 0.006,
315
+ "step": 5100
316
+ },
317
+ {
318
+ "epoch": 0.7,
319
+ "learning_rate": 4.358898820573581e-05,
320
+ "loss": 0.0127,
321
+ "step": 5200
322
+ },
323
+ {
324
+ "epoch": 0.71,
325
+ "learning_rate": 4.3351605326076724e-05,
326
+ "loss": 0.0062,
327
+ "step": 5300
328
+ },
329
+ {
330
+ "epoch": 0.73,
331
+ "learning_rate": 4.3110578997296416e-05,
332
+ "loss": 0.0157,
333
+ "step": 5400
334
+ },
335
+ {
336
+ "epoch": 0.74,
337
+ "learning_rate": 4.286595707172986e-05,
338
+ "loss": 0.0111,
339
+ "step": 5500
340
+ },
341
+ {
342
+ "epoch": 0.75,
343
+ "learning_rate": 4.261778811556646e-05,
344
+ "loss": 0.0141,
345
+ "step": 5600
346
+ },
347
+ {
348
+ "epoch": 0.77,
349
+ "learning_rate": 4.236612139920786e-05,
350
+ "loss": 0.0093,
351
+ "step": 5700
352
+ },
353
+ {
354
+ "epoch": 0.78,
355
+ "learning_rate": 4.2111006887486035e-05,
356
+ "loss": 0.0091,
357
+ "step": 5800
358
+ },
359
+ {
360
+ "epoch": 0.79,
361
+ "learning_rate": 4.185249522974346e-05,
362
+ "loss": 0.0043,
363
+ "step": 5900
364
+ },
365
+ {
366
+ "epoch": 0.81,
367
+ "learning_rate": 4.159063774977748e-05,
368
+ "loss": 0.0072,
369
+ "step": 6000
370
+ },
371
+ {
372
+ "epoch": 0.82,
373
+ "learning_rate": 4.1325486435650625e-05,
374
+ "loss": 0.0063,
375
+ "step": 6100
376
+ },
377
+ {
378
+ "epoch": 0.83,
379
+ "learning_rate": 4.105709392936914e-05,
380
+ "loss": 0.005,
381
+ "step": 6200
382
+ },
383
+ {
384
+ "epoch": 0.85,
385
+ "learning_rate": 4.0785513516431705e-05,
386
+ "loss": 0.0167,
387
+ "step": 6300
388
+ },
389
+ {
390
+ "epoch": 0.86,
391
+ "learning_rate": 4.051079911525031e-05,
392
+ "loss": 0.0068,
393
+ "step": 6400
394
+ },
395
+ {
396
+ "epoch": 0.87,
397
+ "learning_rate": 4.023300526644557e-05,
398
+ "loss": 0.0076,
399
+ "step": 6500
400
+ },
401
+ {
402
+ "epoch": 0.89,
403
+ "learning_rate": 3.9952187122018435e-05,
404
+ "loss": 0.0123,
405
+ "step": 6600
406
+ },
407
+ {
408
+ "epoch": 0.9,
409
+ "learning_rate": 3.966840043440054e-05,
410
+ "loss": 0.0074,
411
+ "step": 6700
412
+ },
413
+ {
414
+ "epoch": 0.91,
415
+ "learning_rate": 3.9381701545385384e-05,
416
+ "loss": 0.0045,
417
+ "step": 6800
418
+ },
419
+ {
420
+ "epoch": 0.93,
421
+ "learning_rate": 3.9092147374942454e-05,
422
+ "loss": 0.0141,
423
+ "step": 6900
424
+ },
425
+ {
426
+ "epoch": 0.94,
427
+ "learning_rate": 3.87997954099166e-05,
428
+ "loss": 0.0036,
429
+ "step": 7000
430
+ },
431
+ {
432
+ "epoch": 0.96,
433
+ "learning_rate": 3.8504703692614795e-05,
434
+ "loss": 0.0077,
435
+ "step": 7100
436
+ },
437
+ {
438
+ "epoch": 0.97,
439
+ "learning_rate": 3.820693080928271e-05,
440
+ "loss": 0.0063,
441
+ "step": 7200
442
+ },
443
+ {
444
+ "epoch": 0.98,
445
+ "learning_rate": 3.790653587847325e-05,
446
+ "loss": 0.0078,
447
+ "step": 7300
448
+ },
449
+ {
450
+ "epoch": 1.0,
451
+ "learning_rate": 3.760357853930936e-05,
452
+ "loss": 0.004,
453
+ "step": 7400
454
+ },
455
+ {
456
+ "epoch": 1.01,
457
+ "learning_rate": 3.72981189396436e-05,
458
+ "loss": 0.003,
459
+ "step": 7500
460
+ },
461
+ {
462
+ "epoch": 1.02,
463
+ "learning_rate": 3.699021772411661e-05,
464
+ "loss": 0.0064,
465
+ "step": 7600
466
+ },
467
+ {
468
+ "epoch": 1.04,
469
+ "learning_rate": 3.667993602211695e-05,
470
+ "loss": 0.0047,
471
+ "step": 7700
472
+ },
473
+ {
474
+ "epoch": 1.05,
475
+ "learning_rate": 3.636733543564481e-05,
476
+ "loss": 0.0031,
477
+ "step": 7800
478
+ },
479
+ {
480
+ "epoch": 1.06,
481
+ "learning_rate": 3.605247802708175e-05,
482
+ "loss": 0.0015,
483
+ "step": 7900
484
+ },
485
+ {
486
+ "epoch": 1.08,
487
+ "learning_rate": 3.5735426306869135e-05,
488
+ "loss": 0.0103,
489
+ "step": 8000
490
+ },
491
+ {
492
+ "epoch": 1.09,
493
+ "learning_rate": 3.5416243221097553e-05,
494
+ "loss": 0.0062,
495
+ "step": 8100
496
+ },
497
+ {
498
+ "epoch": 1.1,
499
+ "learning_rate": 3.509499213900977e-05,
500
+ "loss": 0.0046,
501
+ "step": 8200
502
+ },
503
+ {
504
+ "epoch": 1.12,
505
+ "learning_rate": 3.477497910387336e-05,
506
+ "loss": 0.0082,
507
+ "step": 8300
508
+ },
509
+ {
510
+ "epoch": 1.13,
511
+ "learning_rate": 3.44498028479363e-05,
512
+ "loss": 0.0065,
513
+ "step": 8400
514
+ },
515
+ {
516
+ "epoch": 1.14,
517
+ "learning_rate": 3.412275046861546e-05,
518
+ "loss": 0.0025,
519
+ "step": 8500
520
+ },
521
+ {
522
+ "epoch": 1.16,
523
+ "learning_rate": 3.379388689748946e-05,
524
+ "loss": 0.0047,
525
+ "step": 8600
526
+ },
527
+ {
528
+ "epoch": 1.17,
529
+ "learning_rate": 3.346327742572318e-05,
530
+ "loss": 0.0028,
531
+ "step": 8700
532
+ },
533
+ {
534
+ "epoch": 1.18,
535
+ "learning_rate": 3.3130987691105155e-05,
536
+ "loss": 0.0037,
537
+ "step": 8800
538
+ },
539
+ {
540
+ "epoch": 1.2,
541
+ "learning_rate": 3.279708366501608e-05,
542
+ "loss": 0.0067,
543
+ "step": 8900
544
+ },
545
+ {
546
+ "epoch": 1.21,
547
+ "learning_rate": 3.246163163933119e-05,
548
+ "loss": 0.0045,
549
+ "step": 9000
550
+ },
551
+ {
552
+ "epoch": 1.22,
553
+ "learning_rate": 3.2124698213258904e-05,
554
+ "loss": 0.0038,
555
+ "step": 9100
556
+ },
557
+ {
558
+ "epoch": 1.24,
559
+ "learning_rate": 3.178635028011855e-05,
560
+ "loss": 0.0103,
561
+ "step": 9200
562
+ },
563
+ {
564
+ "epoch": 1.25,
565
+ "learning_rate": 3.144665501405963e-05,
566
+ "loss": 0.0061,
567
+ "step": 9300
568
+ },
569
+ {
570
+ "epoch": 1.26,
571
+ "learning_rate": 3.110567985672535e-05,
572
+ "loss": 0.0042,
573
+ "step": 9400
574
+ },
575
+ {
576
+ "epoch": 1.28,
577
+ "learning_rate": 3.076349250386302e-05,
578
+ "loss": 0.0058,
579
+ "step": 9500
580
+ },
581
+ {
582
+ "epoch": 1.29,
583
+ "learning_rate": 3.0420160891884115e-05,
584
+ "loss": 0.0077,
585
+ "step": 9600
586
+ },
587
+ {
588
+ "epoch": 1.31,
589
+ "learning_rate": 3.0075753184376354e-05,
590
+ "loss": 0.0036,
591
+ "step": 9700
592
+ },
593
+ {
594
+ "epoch": 1.32,
595
+ "learning_rate": 2.9730337758570913e-05,
596
+ "loss": 0.007,
597
+ "step": 9800
598
+ },
599
+ {
600
+ "epoch": 1.33,
601
+ "learning_rate": 2.938398319176699e-05,
602
+ "loss": 0.0073,
603
+ "step": 9900
604
+ },
605
+ {
606
+ "epoch": 1.35,
607
+ "learning_rate": 2.903675824771684e-05,
608
+ "loss": 0.0053,
609
+ "step": 10000
610
+ },
611
+ {
612
+ "epoch": 1.36,
613
+ "learning_rate": 2.8688731862973677e-05,
614
+ "loss": 0.0074,
615
+ "step": 10100
616
+ },
617
+ {
618
+ "epoch": 1.37,
619
+ "learning_rate": 2.833997313320535e-05,
620
+ "loss": 0.004,
621
+ "step": 10200
622
+ },
623
+ {
624
+ "epoch": 1.39,
625
+ "learning_rate": 2.799055129947631e-05,
626
+ "loss": 0.003,
627
+ "step": 10300
628
+ },
629
+ {
630
+ "epoch": 1.4,
631
+ "learning_rate": 2.7644038601038813e-05,
632
+ "loss": 0.0061,
633
+ "step": 10400
634
+ },
635
+ {
636
+ "epoch": 1.41,
637
+ "learning_rate": 2.7293503693483008e-05,
638
+ "loss": 0.0044,
639
+ "step": 10500
640
+ },
641
+ {
642
+ "epoch": 1.43,
643
+ "learning_rate": 2.6942513443527008e-05,
644
+ "loss": 0.0029,
645
+ "step": 10600
646
+ },
647
+ {
648
+ "epoch": 1.44,
649
+ "learning_rate": 2.6591137535271742e-05,
650
+ "loss": 0.001,
651
+ "step": 10700
652
+ },
653
+ {
654
+ "epoch": 1.45,
655
+ "learning_rate": 2.6239445729385104e-05,
656
+ "loss": 0.0047,
657
+ "step": 10800
658
+ },
659
+ {
660
+ "epoch": 1.47,
661
+ "learning_rate": 2.5887507849251914e-05,
662
+ "loss": 0.005,
663
+ "step": 10900
664
+ },
665
+ {
666
+ "epoch": 1.48,
667
+ "learning_rate": 2.5535393767111533e-05,
668
+ "loss": 0.0023,
669
+ "step": 11000
670
+ },
671
+ {
672
+ "epoch": 1.49,
673
+ "learning_rate": 2.5183173390185736e-05,
674
+ "loss": 0.003,
675
+ "step": 11100
676
+ },
677
+ {
678
+ "epoch": 1.51,
679
+ "learning_rate": 2.483091664679959e-05,
680
+ "loss": 0.0016,
681
+ "step": 11200
682
+ },
683
+ {
684
+ "epoch": 1.52,
685
+ "learning_rate": 2.44786934724982e-05,
686
+ "loss": 0.0027,
687
+ "step": 11300
688
+ },
689
+ {
690
+ "epoch": 1.53,
691
+ "learning_rate": 2.4126573796162015e-05,
692
+ "loss": 0.003,
693
+ "step": 11400
694
+ },
695
+ {
696
+ "epoch": 1.55,
697
+ "learning_rate": 2.377462752612344e-05,
698
+ "loss": 0.002,
699
+ "step": 11500
700
+ },
701
+ {
702
+ "epoch": 1.56,
703
+ "learning_rate": 2.3422924536287548e-05,
704
+ "loss": 0.0026,
705
+ "step": 11600
706
+ },
707
+ {
708
+ "epoch": 1.57,
709
+ "learning_rate": 2.307153465225958e-05,
710
+ "loss": 0.0037,
711
+ "step": 11700
712
+ },
713
+ {
714
+ "epoch": 1.59,
715
+ "learning_rate": 2.272052763748209e-05,
716
+ "loss": 0.0063,
717
+ "step": 11800
718
+ },
719
+ {
720
+ "epoch": 1.6,
721
+ "learning_rate": 2.2369973179384445e-05,
722
+ "loss": 0.0046,
723
+ "step": 11900
724
+ },
725
+ {
726
+ "epoch": 1.61,
727
+ "learning_rate": 2.201994087554733e-05,
728
+ "loss": 0.0094,
729
+ "step": 12000
730
+ }
731
+ ],
732
+ "logging_steps": 100,
733
+ "max_steps": 22296,
734
+ "num_train_epochs": 3,
735
+ "save_steps": 3000,
736
+ "total_flos": 1.9310189130989568e+18,
737
+ "trial_name": null,
738
+ "trial_params": null
739
+ }
LLM-Detector-V5-11w/checkpoint-12000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34a6604f99a4d8b8974d5d75cff26a2d414536f9959193cd5fdb32762398d2f1
3
+ size 4600
LLM-Detector-V5-11w/checkpoint-15000/README.md ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: ./Qwen-14B-Chat
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
+ - **Shared by [optional]:** [More Information Needed]
22
+ - **Model type:** [More Information Needed]
23
+ - **Language(s) (NLP):** [More Information Needed]
24
+ - **License:** [More Information Needed]
25
+ - **Finetuned from model [optional]:** [More Information Needed]
26
+
27
+ ### Model Sources [optional]
28
+
29
+ <!-- Provide the basic links for the model. -->
30
+
31
+ - **Repository:** [More Information Needed]
32
+ - **Paper [optional]:** [More Information Needed]
33
+ - **Demo [optional]:** [More Information Needed]
34
+
35
+ ## Uses
36
+
37
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
38
+
39
+ ### Direct Use
40
+
41
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
42
+
43
+ [More Information Needed]
44
+
45
+ ### Downstream Use [optional]
46
+
47
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Out-of-Scope Use
52
+
53
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
54
+
55
+ [More Information Needed]
56
+
57
+ ## Bias, Risks, and Limitations
58
+
59
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ### Recommendations
64
+
65
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
66
+
67
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
68
+
69
+ ## How to Get Started with the Model
70
+
71
+ Use the code below to get started with the model.
72
+
73
+ [More Information Needed]
74
+
75
+ ## Training Details
76
+
77
+ ### Training Data
78
+
79
+ <!-- This should link to a Data 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. -->
80
+
81
+ [More Information Needed]
82
+
83
+ ### Training Procedure
84
+
85
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
86
+
87
+ #### Preprocessing [optional]
88
+
89
+ [More Information Needed]
90
+
91
+
92
+ #### Training Hyperparameters
93
+
94
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
95
+
96
+ #### Speeds, Sizes, Times [optional]
97
+
98
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
99
+
100
+ [More Information Needed]
101
+
102
+ ## Evaluation
103
+
104
+ <!-- This section describes the evaluation protocols and provides the results. -->
105
+
106
+ ### Testing Data, Factors & Metrics
107
+
108
+ #### Testing Data
109
+
110
+ <!-- This should link to a Data Card if possible. -->
111
+
112
+ [More Information Needed]
113
+
114
+ #### Factors
115
+
116
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Metrics
121
+
122
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
123
+
124
+ [More Information Needed]
125
+
126
+ ### Results
127
+
128
+ [More Information Needed]
129
+
130
+ #### Summary
131
+
132
+
133
+
134
+ ## Model Examination [optional]
135
+
136
+ <!-- Relevant interpretability work for the model goes here -->
137
+
138
+ [More Information Needed]
139
+
140
+ ## Environmental Impact
141
+
142
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
143
+
144
+ 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).
145
+
146
+ - **Hardware Type:** [More Information Needed]
147
+ - **Hours used:** [More Information Needed]
148
+ - **Cloud Provider:** [More Information Needed]
149
+ - **Compute Region:** [More Information Needed]
150
+ - **Carbon Emitted:** [More Information Needed]
151
+
152
+ ## Technical Specifications [optional]
153
+
154
+ ### Model Architecture and Objective
155
+
156
+ [More Information Needed]
157
+
158
+ ### Compute Infrastructure
159
+
160
+ [More Information Needed]
161
+
162
+ #### Hardware
163
+
164
+ [More Information Needed]
165
+
166
+ #### Software
167
+
168
+ [More Information Needed]
169
+
170
+ ## Citation [optional]
171
+
172
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
173
+
174
+ **BibTeX:**
175
+
176
+ [More Information Needed]
177
+
178
+ **APA:**
179
+
180
+ [More Information Needed]
181
+
182
+ ## Glossary [optional]
183
+
184
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
185
+
186
+ [More Information Needed]
187
+
188
+ ## More Information [optional]
189
+
190
+ [More Information Needed]
191
+
192
+ ## Model Card Authors [optional]
193
+
194
+ [More Information Needed]
195
+
196
+ ## Model Card Contact
197
+
198
+ [More Information Needed]
199
+
200
+
201
+ ## Training procedure
202
+
203
+
204
+ The following `bitsandbytes` quantization config was used during training:
205
+ - quant_method: QuantizationMethod.BITS_AND_BYTES
206
+ - load_in_8bit: False
207
+ - load_in_4bit: True
208
+ - llm_int8_threshold: 6.0
209
+ - llm_int8_skip_modules: None
210
+ - llm_int8_enable_fp32_cpu_offload: False
211
+ - llm_int8_has_fp16_weight: False
212
+ - bnb_4bit_quant_type: nf4
213
+ - bnb_4bit_use_double_quant: True
214
+ - bnb_4bit_compute_dtype: float16
215
+
216
+ ### Framework versions
217
+
218
+
219
+ - PEFT 0.6.2
LLM-Detector-V5-11w/checkpoint-15000/adapter_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "./Qwen-14B-Chat",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "lora_alpha": 16.0,
12
+ "lora_dropout": 0.1,
13
+ "modules_to_save": null,
14
+ "peft_type": "LORA",
15
+ "r": 8,
16
+ "rank_pattern": {},
17
+ "revision": null,
18
+ "target_modules": [
19
+ "c_attn"
20
+ ],
21
+ "task_type": "CAUSAL_LM"
22
+ }
LLM-Detector-V5-11w/checkpoint-15000/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5e3ade88c7690530234531f5ea3ba1dafb74162f68a6a4c2b8854bf7bb98313
3
+ size 26243102
LLM-Detector-V5-11w/checkpoint-15000/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:261495d3911e1b36673858fccc3636350bf81734d6a63cbe6807d07565207f9b
3
+ size 52496442
LLM-Detector-V5-11w/checkpoint-15000/qwen.tiktoken ADDED
The diff for this file is too large to render. See raw diff
 
LLM-Detector-V5-11w/checkpoint-15000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:092fd626805236851c2298469fb04906492bc35a31861f1e7955e1bef1d7670e
3
+ size 14244
LLM-Detector-V5-11w/checkpoint-15000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ea05cc55f2f45f53b449edaad91d7b12c981326c2d9b625bf8e619db7e03be2
3
+ size 1064
LLM-Detector-V5-11w/checkpoint-15000/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_end|>"
4
+ ],
5
+ "eos_token": "<|endoftext|>",
6
+ "pad_token": "<|endoftext|>"
7
+ }
LLM-Detector-V5-11w/checkpoint-15000/tokenization_qwen.py ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Alibaba Cloud.
2
+ #
3
+ # This source code is licensed under the license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ """Tokenization classes for QWen."""
7
+
8
+ import base64
9
+ import logging
10
+ import os
11
+ import unicodedata
12
+ from typing import Collection, Dict, List, Set, Tuple, Union
13
+
14
+ import tiktoken
15
+ from transformers import PreTrainedTokenizer, AddedToken
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ VOCAB_FILES_NAMES = {"vocab_file": "qwen.tiktoken"}
21
+
22
+ PAT_STR = r"""(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}| ?[^\s\p{L}\p{N}]+[\r\n]*|\s*[\r\n]+|\s+(?!\S)|\s+"""
23
+ ENDOFTEXT = "<|endoftext|>"
24
+ IMSTART = "<|im_start|>"
25
+ IMEND = "<|im_end|>"
26
+ # as the default behavior is changed to allow special tokens in
27
+ # regular texts, the surface forms of special tokens need to be
28
+ # as different as possible to minimize the impact
29
+ EXTRAS = tuple((f"<|extra_{i}|>" for i in range(205)))
30
+ # changed to use actual index to avoid misconfiguration with vocabulary expansion
31
+ SPECIAL_START_ID = 151643
32
+ SPECIAL_TOKENS = tuple(
33
+ enumerate(
34
+ (
35
+ (
36
+ ENDOFTEXT,
37
+ IMSTART,
38
+ IMEND,
39
+ )
40
+ + EXTRAS
41
+ ),
42
+ start=SPECIAL_START_ID,
43
+ )
44
+ )
45
+ SPECIAL_TOKENS_SET = set(t for i, t in SPECIAL_TOKENS)
46
+
47
+
48
+ def _load_tiktoken_bpe(tiktoken_bpe_file: str) -> Dict[bytes, int]:
49
+ with open(tiktoken_bpe_file, "rb") as f:
50
+ contents = f.read()
51
+ return {
52
+ base64.b64decode(token): int(rank)
53
+ for token, rank in (line.split() for line in contents.splitlines() if line)
54
+ }
55
+
56
+
57
+ class QWenTokenizer(PreTrainedTokenizer):
58
+ """QWen tokenizer."""
59
+
60
+ vocab_files_names = VOCAB_FILES_NAMES
61
+
62
+ def __init__(
63
+ self,
64
+ vocab_file,
65
+ errors="replace",
66
+ extra_vocab_file=None,
67
+ **kwargs,
68
+ ):
69
+ super().__init__(**kwargs)
70
+
71
+ # how to handle errors in decoding UTF-8 byte sequences
72
+ # use ignore if you are in streaming inference
73
+ self.errors = errors
74
+
75
+ self.mergeable_ranks = _load_tiktoken_bpe(vocab_file) # type: Dict[bytes, int]
76
+ self.special_tokens = {
77
+ token: index
78
+ for index, token in SPECIAL_TOKENS
79
+ }
80
+
81
+ # try load extra vocab from file
82
+ if extra_vocab_file is not None:
83
+ used_ids = set(self.mergeable_ranks.values()) | set(self.special_tokens.values())
84
+ extra_mergeable_ranks = _load_tiktoken_bpe(extra_vocab_file)
85
+ for token, index in extra_mergeable_ranks.items():
86
+ if token in self.mergeable_ranks:
87
+ logger.info(f"extra token {token} exists, skipping")
88
+ continue
89
+ if index in used_ids:
90
+ logger.info(f'the index {index} for extra token {token} exists, skipping')
91
+ continue
92
+ self.mergeable_ranks[token] = index
93
+ # the index may be sparse after this, but don't worry tiktoken.Encoding will handle this
94
+
95
+ enc = tiktoken.Encoding(
96
+ "Qwen",
97
+ pat_str=PAT_STR,
98
+ mergeable_ranks=self.mergeable_ranks,
99
+ special_tokens=self.special_tokens,
100
+ )
101
+ assert (
102
+ len(self.mergeable_ranks) + len(self.special_tokens) == enc.n_vocab
103
+ ), f"{len(self.mergeable_ranks) + len(self.special_tokens)} != {enc.n_vocab} in encoding"
104
+
105
+ self.decoder = {
106
+ v: k for k, v in self.mergeable_ranks.items()
107
+ } # type: dict[int, bytes|str]
108
+ self.decoder.update({v: k for k, v in self.special_tokens.items()})
109
+
110
+ self.tokenizer = enc # type: tiktoken.Encoding
111
+
112
+ self.eod_id = self.tokenizer.eot_token
113
+ self.im_start_id = self.special_tokens[IMSTART]
114
+ self.im_end_id = self.special_tokens[IMEND]
115
+
116
+ def __getstate__(self):
117
+ # for pickle lovers
118
+ state = self.__dict__.copy()
119
+ del state["tokenizer"]
120
+ return state
121
+
122
+ def __setstate__(self, state):
123
+ # tokenizer is not python native; don't pass it; rebuild it
124
+ self.__dict__.update(state)
125
+ enc = tiktoken.Encoding(
126
+ "Qwen",
127
+ pat_str=PAT_STR,
128
+ mergeable_ranks=self.mergeable_ranks,
129
+ special_tokens=self.special_tokens,
130
+ )
131
+ self.tokenizer = enc
132
+
133
+ def __len__(self) -> int:
134
+ return self.tokenizer.n_vocab
135
+
136
+ def get_vocab(self) -> Dict[bytes, int]:
137
+ return self.mergeable_ranks
138
+
139
+ def convert_tokens_to_ids(
140
+ self, tokens: Union[bytes, str, List[Union[bytes, str]]]
141
+ ) -> List[int]:
142
+ ids = []
143
+ if isinstance(tokens, (str, bytes)):
144
+ if tokens in self.special_tokens:
145
+ return self.special_tokens[tokens]
146
+ else:
147
+ return self.mergeable_ranks.get(tokens)
148
+ for token in tokens:
149
+ if token in self.special_tokens:
150
+ ids.append(self.special_tokens[token])
151
+ else:
152
+ ids.append(self.mergeable_ranks.get(token))
153
+ return ids
154
+
155
+ def _add_tokens(
156
+ self,
157
+ new_tokens: Union[List[str], List[AddedToken]],
158
+ special_tokens: bool = False,
159
+ ) -> int:
160
+ if not special_tokens and new_tokens:
161
+ raise ValueError("Adding regular tokens is not supported")
162
+ for token in new_tokens:
163
+ surface_form = token.content if isinstance(token, AddedToken) else token
164
+ if surface_form not in SPECIAL_TOKENS_SET:
165
+ raise ValueError("Adding unknown special tokens is not supported")
166
+ return 0
167
+
168
+ def save_vocabulary(self, save_directory: str, **kwargs) -> Tuple[str]:
169
+ """
170
+ Save only the vocabulary of the tokenizer (vocabulary).
171
+
172
+ Returns:
173
+ `Tuple(str)`: Paths to the files saved.
174
+ """
175
+ file_path = os.path.join(save_directory, "qwen.tiktoken")
176
+ with open(file_path, "w", encoding="utf8") as w:
177
+ for k, v in self.mergeable_ranks.items():
178
+ line = base64.b64encode(k).decode("utf8") + " " + str(v) + "\n"
179
+ w.write(line)
180
+ return (file_path,)
181
+
182
+ def tokenize(
183
+ self,
184
+ text: str,
185
+ allowed_special: Union[Set, str] = "all",
186
+ disallowed_special: Union[Collection, str] = (),
187
+ **kwargs,
188
+ ) -> List[Union[bytes, str]]:
189
+ """
190
+ Converts a string in a sequence of tokens.
191
+
192
+ Args:
193
+ text (`str`):
194
+ The sequence to be encoded.
195
+ allowed_special (`Literal["all"]` or `set`):
196
+ The surface forms of the tokens to be encoded as special tokens in regular texts.
197
+ Default to "all".
198
+ disallowed_special (`Literal["all"]` or `Collection`):
199
+ The surface forms of the tokens that should not be in regular texts and trigger errors.
200
+ Default to an empty tuple.
201
+
202
+ kwargs (additional keyword arguments, *optional*):
203
+ Will be passed to the underlying model specific encode method.
204
+
205
+ Returns:
206
+ `List[bytes|str]`: The list of tokens.
207
+ """
208
+ tokens = []
209
+ text = unicodedata.normalize("NFC", text)
210
+
211
+ # this implementation takes a detour: text -> token id -> token surface forms
212
+ for t in self.tokenizer.encode(
213
+ text, allowed_special=allowed_special, disallowed_special=disallowed_special
214
+ ):
215
+ tokens.append(self.decoder[t])
216
+ return tokens
217
+
218
+ def convert_tokens_to_string(self, tokens: List[Union[bytes, str]]) -> str:
219
+ """
220
+ Converts a sequence of tokens in a single string.
221
+ """
222
+ text = ""
223
+ temp = b""
224
+ for t in tokens:
225
+ if isinstance(t, str):
226
+ if temp:
227
+ text += temp.decode("utf-8", errors=self.errors)
228
+ temp = b""
229
+ text += t
230
+ elif isinstance(t, bytes):
231
+ temp += t
232
+ else:
233
+ raise TypeError("token should only be of type types or str")
234
+ if temp:
235
+ text += temp.decode("utf-8", errors=self.errors)
236
+ return text
237
+
238
+ @property
239
+ def vocab_size(self):
240
+ return self.tokenizer.n_vocab
241
+
242
+ def _convert_id_to_token(self, index: int) -> Union[bytes, str]:
243
+ """Converts an id to a token, special tokens included"""
244
+ if index in self.decoder:
245
+ return self.decoder[index]
246
+ raise ValueError("unknown ids")
247
+
248
+ def _convert_token_to_id(self, token: Union[bytes, str]) -> int:
249
+ """Converts a token to an id using the vocab, special tokens included"""
250
+ if token in self.special_tokens:
251
+ return self.special_tokens[token]
252
+ if token in self.mergeable_ranks:
253
+ return self.mergeable_ranks[token]
254
+ raise ValueError("unknown token")
255
+
256
+ def _tokenize(self, text: str, **kwargs):
257
+ """
258
+ Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based
259
+ vocabulary or sub-words for sub-word-based vocabularies (BPE/SentencePieces/WordPieces).
260
+
261
+ Do NOT take care of added tokens.
262
+ """
263
+ raise NotImplementedError
264
+
265
+ def _decode(
266
+ self,
267
+ token_ids: Union[int, List[int]],
268
+ skip_special_tokens: bool = False,
269
+ errors: str = None,
270
+ **kwargs,
271
+ ) -> str:
272
+ if isinstance(token_ids, int):
273
+ token_ids = [token_ids]
274
+ if skip_special_tokens:
275
+ token_ids = [i for i in token_ids if i < self.eod_id]
276
+ return self.tokenizer.decode(token_ids, errors=errors or self.errors)
LLM-Detector-V5-11w/checkpoint-15000/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoTokenizer": [
4
+ "tokenization_qwen.QWenTokenizer",
5
+ null
6
+ ]
7
+ },
8
+ "clean_up_tokenization_spaces": true,
9
+ "model_max_length": 8192,
10
+ "padding_side": "right",
11
+ "split_special_tokens": false,
12
+ "tokenizer_class": "QWenTokenizer"
13
+ }
LLM-Detector-V5-11w/checkpoint-15000/trainer_state.json ADDED
@@ -0,0 +1,919 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 2.018095590461135,
5
+ "eval_steps": 500,
6
+ "global_step": 15000,
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.01,
13
+ "learning_rate": 4.9997567688496474e-05,
14
+ "loss": 2.8699,
15
+ "step": 100
16
+ },
17
+ {
18
+ "epoch": 0.03,
19
+ "learning_rate": 4.9990172715142793e-05,
20
+ "loss": 0.0389,
21
+ "step": 200
22
+ },
23
+ {
24
+ "epoch": 0.04,
25
+ "learning_rate": 4.997781629993153e-05,
26
+ "loss": 0.0301,
27
+ "step": 300
28
+ },
29
+ {
30
+ "epoch": 0.05,
31
+ "learning_rate": 4.9960500896052476e-05,
32
+ "loss": 0.0244,
33
+ "step": 400
34
+ },
35
+ {
36
+ "epoch": 0.07,
37
+ "learning_rate": 4.993822994123172e-05,
38
+ "loss": 0.0151,
39
+ "step": 500
40
+ },
41
+ {
42
+ "epoch": 0.08,
43
+ "learning_rate": 4.9911007857049264e-05,
44
+ "loss": 0.012,
45
+ "step": 600
46
+ },
47
+ {
48
+ "epoch": 0.09,
49
+ "learning_rate": 4.987884004806111e-05,
50
+ "loss": 0.0268,
51
+ "step": 700
52
+ },
53
+ {
54
+ "epoch": 0.11,
55
+ "learning_rate": 4.984173290072626e-05,
56
+ "loss": 0.0187,
57
+ "step": 800
58
+ },
59
+ {
60
+ "epoch": 0.12,
61
+ "learning_rate": 4.979969378213884e-05,
62
+ "loss": 0.0166,
63
+ "step": 900
64
+ },
65
+ {
66
+ "epoch": 0.13,
67
+ "learning_rate": 4.975273103856537e-05,
68
+ "loss": 0.022,
69
+ "step": 1000
70
+ },
71
+ {
72
+ "epoch": 0.15,
73
+ "learning_rate": 4.970085399378785e-05,
74
+ "loss": 0.0194,
75
+ "step": 1100
76
+ },
77
+ {
78
+ "epoch": 0.16,
79
+ "learning_rate": 4.964407294725254e-05,
80
+ "loss": 0.0182,
81
+ "step": 1200
82
+ },
83
+ {
84
+ "epoch": 0.17,
85
+ "learning_rate": 4.958239917202523e-05,
86
+ "loss": 0.0204,
87
+ "step": 1300
88
+ },
89
+ {
90
+ "epoch": 0.19,
91
+ "learning_rate": 4.9515844912553106e-05,
92
+ "loss": 0.013,
93
+ "step": 1400
94
+ },
95
+ {
96
+ "epoch": 0.2,
97
+ "learning_rate": 4.944442338223378e-05,
98
+ "loss": 0.0107,
99
+ "step": 1500
100
+ },
101
+ {
102
+ "epoch": 0.22,
103
+ "learning_rate": 4.9368148760792e-05,
104
+ "loss": 0.0156,
105
+ "step": 1600
106
+ },
107
+ {
108
+ "epoch": 0.23,
109
+ "learning_rate": 4.9287036191464414e-05,
110
+ "loss": 0.0141,
111
+ "step": 1700
112
+ },
113
+ {
114
+ "epoch": 0.24,
115
+ "learning_rate": 4.9201101777993116e-05,
116
+ "loss": 0.0104,
117
+ "step": 1800
118
+ },
119
+ {
120
+ "epoch": 0.26,
121
+ "learning_rate": 4.911036258142853e-05,
122
+ "loss": 0.0087,
123
+ "step": 1900
124
+ },
125
+ {
126
+ "epoch": 0.27,
127
+ "learning_rate": 4.9014836616742065e-05,
128
+ "loss": 0.013,
129
+ "step": 2000
130
+ },
131
+ {
132
+ "epoch": 0.28,
133
+ "learning_rate": 4.891454284924965e-05,
134
+ "loss": 0.0194,
135
+ "step": 2100
136
+ },
137
+ {
138
+ "epoch": 0.3,
139
+ "learning_rate": 4.8809501190846284e-05,
140
+ "loss": 0.0131,
141
+ "step": 2200
142
+ },
143
+ {
144
+ "epoch": 0.31,
145
+ "learning_rate": 4.8699732496052965e-05,
146
+ "loss": 0.0135,
147
+ "step": 2300
148
+ },
149
+ {
150
+ "epoch": 0.32,
151
+ "learning_rate": 4.858525855787619e-05,
152
+ "loss": 0.0106,
153
+ "step": 2400
154
+ },
155
+ {
156
+ "epoch": 0.34,
157
+ "learning_rate": 4.846610210348137e-05,
158
+ "loss": 0.0089,
159
+ "step": 2500
160
+ },
161
+ {
162
+ "epoch": 0.35,
163
+ "learning_rate": 4.8342286789680605e-05,
164
+ "loss": 0.0086,
165
+ "step": 2600
166
+ },
167
+ {
168
+ "epoch": 0.36,
169
+ "learning_rate": 4.8213837198235996e-05,
170
+ "loss": 0.0035,
171
+ "step": 2700
172
+ },
173
+ {
174
+ "epoch": 0.38,
175
+ "learning_rate": 4.8080778830979276e-05,
176
+ "loss": 0.0121,
177
+ "step": 2800
178
+ },
179
+ {
180
+ "epoch": 0.39,
181
+ "learning_rate": 4.794313810474878e-05,
182
+ "loss": 0.0146,
183
+ "step": 2900
184
+ },
185
+ {
186
+ "epoch": 0.4,
187
+ "learning_rate": 4.780094234614479e-05,
188
+ "loss": 0.0047,
189
+ "step": 3000
190
+ },
191
+ {
192
+ "epoch": 0.42,
193
+ "learning_rate": 4.765421978610418e-05,
194
+ "loss": 0.0096,
195
+ "step": 3100
196
+ },
197
+ {
198
+ "epoch": 0.43,
199
+ "learning_rate": 4.750299955429562e-05,
200
+ "loss": 0.0116,
201
+ "step": 3200
202
+ },
203
+ {
204
+ "epoch": 0.44,
205
+ "learning_rate": 4.734731167333625e-05,
206
+ "loss": 0.0192,
207
+ "step": 3300
208
+ },
209
+ {
210
+ "epoch": 0.46,
211
+ "learning_rate": 4.718718705283113e-05,
212
+ "loss": 0.0111,
213
+ "step": 3400
214
+ },
215
+ {
216
+ "epoch": 0.47,
217
+ "learning_rate": 4.702265748323661e-05,
218
+ "loss": 0.0114,
219
+ "step": 3500
220
+ },
221
+ {
222
+ "epoch": 0.48,
223
+ "learning_rate": 4.685375562954876e-05,
224
+ "loss": 0.0113,
225
+ "step": 3600
226
+ },
227
+ {
228
+ "epoch": 0.5,
229
+ "learning_rate": 4.668051502481818e-05,
230
+ "loss": 0.0097,
231
+ "step": 3700
232
+ },
233
+ {
234
+ "epoch": 0.51,
235
+ "learning_rate": 4.650297006349257e-05,
236
+ "loss": 0.0094,
237
+ "step": 3800
238
+ },
239
+ {
240
+ "epoch": 0.52,
241
+ "learning_rate": 4.63211559945881e-05,
242
+ "loss": 0.0059,
243
+ "step": 3900
244
+ },
245
+ {
246
+ "epoch": 0.54,
247
+ "learning_rate": 4.613699021830524e-05,
248
+ "loss": 0.0195,
249
+ "step": 4000
250
+ },
251
+ {
252
+ "epoch": 0.55,
253
+ "learning_rate": 4.59467888395669e-05,
254
+ "loss": 0.0088,
255
+ "step": 4100
256
+ },
257
+ {
258
+ "epoch": 0.57,
259
+ "learning_rate": 4.575242877508777e-05,
260
+ "loss": 0.0087,
261
+ "step": 4200
262
+ },
263
+ {
264
+ "epoch": 0.58,
265
+ "learning_rate": 4.5553948612282607e-05,
266
+ "loss": 0.0088,
267
+ "step": 4300
268
+ },
269
+ {
270
+ "epoch": 0.59,
271
+ "learning_rate": 4.5351387756552846e-05,
272
+ "loss": 0.0122,
273
+ "step": 4400
274
+ },
275
+ {
276
+ "epoch": 0.61,
277
+ "learning_rate": 4.51447864234632e-05,
278
+ "loss": 0.0081,
279
+ "step": 4500
280
+ },
281
+ {
282
+ "epoch": 0.62,
283
+ "learning_rate": 4.4934185630757484e-05,
284
+ "loss": 0.0079,
285
+ "step": 4600
286
+ },
287
+ {
288
+ "epoch": 0.63,
289
+ "learning_rate": 4.4719627190215064e-05,
290
+ "loss": 0.011,
291
+ "step": 4700
292
+ },
293
+ {
294
+ "epoch": 0.65,
295
+ "learning_rate": 4.450115369934976e-05,
296
+ "loss": 0.0146,
297
+ "step": 4800
298
+ },
299
+ {
300
+ "epoch": 0.66,
301
+ "learning_rate": 4.427880853295274e-05,
302
+ "loss": 0.0057,
303
+ "step": 4900
304
+ },
305
+ {
306
+ "epoch": 0.67,
307
+ "learning_rate": 4.4052635834481025e-05,
308
+ "loss": 0.0051,
309
+ "step": 5000
310
+ },
311
+ {
312
+ "epoch": 0.69,
313
+ "learning_rate": 4.3822680507293455e-05,
314
+ "loss": 0.006,
315
+ "step": 5100
316
+ },
317
+ {
318
+ "epoch": 0.7,
319
+ "learning_rate": 4.358898820573581e-05,
320
+ "loss": 0.0127,
321
+ "step": 5200
322
+ },
323
+ {
324
+ "epoch": 0.71,
325
+ "learning_rate": 4.3351605326076724e-05,
326
+ "loss": 0.0062,
327
+ "step": 5300
328
+ },
329
+ {
330
+ "epoch": 0.73,
331
+ "learning_rate": 4.3110578997296416e-05,
332
+ "loss": 0.0157,
333
+ "step": 5400
334
+ },
335
+ {
336
+ "epoch": 0.74,
337
+ "learning_rate": 4.286595707172986e-05,
338
+ "loss": 0.0111,
339
+ "step": 5500
340
+ },
341
+ {
342
+ "epoch": 0.75,
343
+ "learning_rate": 4.261778811556646e-05,
344
+ "loss": 0.0141,
345
+ "step": 5600
346
+ },
347
+ {
348
+ "epoch": 0.77,
349
+ "learning_rate": 4.236612139920786e-05,
350
+ "loss": 0.0093,
351
+ "step": 5700
352
+ },
353
+ {
354
+ "epoch": 0.78,
355
+ "learning_rate": 4.2111006887486035e-05,
356
+ "loss": 0.0091,
357
+ "step": 5800
358
+ },
359
+ {
360
+ "epoch": 0.79,
361
+ "learning_rate": 4.185249522974346e-05,
362
+ "loss": 0.0043,
363
+ "step": 5900
364
+ },
365
+ {
366
+ "epoch": 0.81,
367
+ "learning_rate": 4.159063774977748e-05,
368
+ "loss": 0.0072,
369
+ "step": 6000
370
+ },
371
+ {
372
+ "epoch": 0.82,
373
+ "learning_rate": 4.1325486435650625e-05,
374
+ "loss": 0.0063,
375
+ "step": 6100
376
+ },
377
+ {
378
+ "epoch": 0.83,
379
+ "learning_rate": 4.105709392936914e-05,
380
+ "loss": 0.005,
381
+ "step": 6200
382
+ },
383
+ {
384
+ "epoch": 0.85,
385
+ "learning_rate": 4.0785513516431705e-05,
386
+ "loss": 0.0167,
387
+ "step": 6300
388
+ },
389
+ {
390
+ "epoch": 0.86,
391
+ "learning_rate": 4.051079911525031e-05,
392
+ "loss": 0.0068,
393
+ "step": 6400
394
+ },
395
+ {
396
+ "epoch": 0.87,
397
+ "learning_rate": 4.023300526644557e-05,
398
+ "loss": 0.0076,
399
+ "step": 6500
400
+ },
401
+ {
402
+ "epoch": 0.89,
403
+ "learning_rate": 3.9952187122018435e-05,
404
+ "loss": 0.0123,
405
+ "step": 6600
406
+ },
407
+ {
408
+ "epoch": 0.9,
409
+ "learning_rate": 3.966840043440054e-05,
410
+ "loss": 0.0074,
411
+ "step": 6700
412
+ },
413
+ {
414
+ "epoch": 0.91,
415
+ "learning_rate": 3.9381701545385384e-05,
416
+ "loss": 0.0045,
417
+ "step": 6800
418
+ },
419
+ {
420
+ "epoch": 0.93,
421
+ "learning_rate": 3.9092147374942454e-05,
422
+ "loss": 0.0141,
423
+ "step": 6900
424
+ },
425
+ {
426
+ "epoch": 0.94,
427
+ "learning_rate": 3.87997954099166e-05,
428
+ "loss": 0.0036,
429
+ "step": 7000
430
+ },
431
+ {
432
+ "epoch": 0.96,
433
+ "learning_rate": 3.8504703692614795e-05,
434
+ "loss": 0.0077,
435
+ "step": 7100
436
+ },
437
+ {
438
+ "epoch": 0.97,
439
+ "learning_rate": 3.820693080928271e-05,
440
+ "loss": 0.0063,
441
+ "step": 7200
442
+ },
443
+ {
444
+ "epoch": 0.98,
445
+ "learning_rate": 3.790653587847325e-05,
446
+ "loss": 0.0078,
447
+ "step": 7300
448
+ },
449
+ {
450
+ "epoch": 1.0,
451
+ "learning_rate": 3.760357853930936e-05,
452
+ "loss": 0.004,
453
+ "step": 7400
454
+ },
455
+ {
456
+ "epoch": 1.01,
457
+ "learning_rate": 3.72981189396436e-05,
458
+ "loss": 0.003,
459
+ "step": 7500
460
+ },
461
+ {
462
+ "epoch": 1.02,
463
+ "learning_rate": 3.699021772411661e-05,
464
+ "loss": 0.0064,
465
+ "step": 7600
466
+ },
467
+ {
468
+ "epoch": 1.04,
469
+ "learning_rate": 3.667993602211695e-05,
470
+ "loss": 0.0047,
471
+ "step": 7700
472
+ },
473
+ {
474
+ "epoch": 1.05,
475
+ "learning_rate": 3.636733543564481e-05,
476
+ "loss": 0.0031,
477
+ "step": 7800
478
+ },
479
+ {
480
+ "epoch": 1.06,
481
+ "learning_rate": 3.605247802708175e-05,
482
+ "loss": 0.0015,
483
+ "step": 7900
484
+ },
485
+ {
486
+ "epoch": 1.08,
487
+ "learning_rate": 3.5735426306869135e-05,
488
+ "loss": 0.0103,
489
+ "step": 8000
490
+ },
491
+ {
492
+ "epoch": 1.09,
493
+ "learning_rate": 3.5416243221097553e-05,
494
+ "loss": 0.0062,
495
+ "step": 8100
496
+ },
497
+ {
498
+ "epoch": 1.1,
499
+ "learning_rate": 3.509499213900977e-05,
500
+ "loss": 0.0046,
501
+ "step": 8200
502
+ },
503
+ {
504
+ "epoch": 1.12,
505
+ "learning_rate": 3.477497910387336e-05,
506
+ "loss": 0.0082,
507
+ "step": 8300
508
+ },
509
+ {
510
+ "epoch": 1.13,
511
+ "learning_rate": 3.44498028479363e-05,
512
+ "loss": 0.0065,
513
+ "step": 8400
514
+ },
515
+ {
516
+ "epoch": 1.14,
517
+ "learning_rate": 3.412275046861546e-05,
518
+ "loss": 0.0025,
519
+ "step": 8500
520
+ },
521
+ {
522
+ "epoch": 1.16,
523
+ "learning_rate": 3.379388689748946e-05,
524
+ "loss": 0.0047,
525
+ "step": 8600
526
+ },
527
+ {
528
+ "epoch": 1.17,
529
+ "learning_rate": 3.346327742572318e-05,
530
+ "loss": 0.0028,
531
+ "step": 8700
532
+ },
533
+ {
534
+ "epoch": 1.18,
535
+ "learning_rate": 3.3130987691105155e-05,
536
+ "loss": 0.0037,
537
+ "step": 8800
538
+ },
539
+ {
540
+ "epoch": 1.2,
541
+ "learning_rate": 3.279708366501608e-05,
542
+ "loss": 0.0067,
543
+ "step": 8900
544
+ },
545
+ {
546
+ "epoch": 1.21,
547
+ "learning_rate": 3.246163163933119e-05,
548
+ "loss": 0.0045,
549
+ "step": 9000
550
+ },
551
+ {
552
+ "epoch": 1.22,
553
+ "learning_rate": 3.2124698213258904e-05,
554
+ "loss": 0.0038,
555
+ "step": 9100
556
+ },
557
+ {
558
+ "epoch": 1.24,
559
+ "learning_rate": 3.178635028011855e-05,
560
+ "loss": 0.0103,
561
+ "step": 9200
562
+ },
563
+ {
564
+ "epoch": 1.25,
565
+ "learning_rate": 3.144665501405963e-05,
566
+ "loss": 0.0061,
567
+ "step": 9300
568
+ },
569
+ {
570
+ "epoch": 1.26,
571
+ "learning_rate": 3.110567985672535e-05,
572
+ "loss": 0.0042,
573
+ "step": 9400
574
+ },
575
+ {
576
+ "epoch": 1.28,
577
+ "learning_rate": 3.076349250386302e-05,
578
+ "loss": 0.0058,
579
+ "step": 9500
580
+ },
581
+ {
582
+ "epoch": 1.29,
583
+ "learning_rate": 3.0420160891884115e-05,
584
+ "loss": 0.0077,
585
+ "step": 9600
586
+ },
587
+ {
588
+ "epoch": 1.31,
589
+ "learning_rate": 3.0075753184376354e-05,
590
+ "loss": 0.0036,
591
+ "step": 9700
592
+ },
593
+ {
594
+ "epoch": 1.32,
595
+ "learning_rate": 2.9730337758570913e-05,
596
+ "loss": 0.007,
597
+ "step": 9800
598
+ },
599
+ {
600
+ "epoch": 1.33,
601
+ "learning_rate": 2.938398319176699e-05,
602
+ "loss": 0.0073,
603
+ "step": 9900
604
+ },
605
+ {
606
+ "epoch": 1.35,
607
+ "learning_rate": 2.903675824771684e-05,
608
+ "loss": 0.0053,
609
+ "step": 10000
610
+ },
611
+ {
612
+ "epoch": 1.36,
613
+ "learning_rate": 2.8688731862973677e-05,
614
+ "loss": 0.0074,
615
+ "step": 10100
616
+ },
617
+ {
618
+ "epoch": 1.37,
619
+ "learning_rate": 2.833997313320535e-05,
620
+ "loss": 0.004,
621
+ "step": 10200
622
+ },
623
+ {
624
+ "epoch": 1.39,
625
+ "learning_rate": 2.799055129947631e-05,
626
+ "loss": 0.003,
627
+ "step": 10300
628
+ },
629
+ {
630
+ "epoch": 1.4,
631
+ "learning_rate": 2.7644038601038813e-05,
632
+ "loss": 0.0061,
633
+ "step": 10400
634
+ },
635
+ {
636
+ "epoch": 1.41,
637
+ "learning_rate": 2.7293503693483008e-05,
638
+ "loss": 0.0044,
639
+ "step": 10500
640
+ },
641
+ {
642
+ "epoch": 1.43,
643
+ "learning_rate": 2.6942513443527008e-05,
644
+ "loss": 0.0029,
645
+ "step": 10600
646
+ },
647
+ {
648
+ "epoch": 1.44,
649
+ "learning_rate": 2.6591137535271742e-05,
650
+ "loss": 0.001,
651
+ "step": 10700
652
+ },
653
+ {
654
+ "epoch": 1.45,
655
+ "learning_rate": 2.6239445729385104e-05,
656
+ "loss": 0.0047,
657
+ "step": 10800
658
+ },
659
+ {
660
+ "epoch": 1.47,
661
+ "learning_rate": 2.5887507849251914e-05,
662
+ "loss": 0.005,
663
+ "step": 10900
664
+ },
665
+ {
666
+ "epoch": 1.48,
667
+ "learning_rate": 2.5535393767111533e-05,
668
+ "loss": 0.0023,
669
+ "step": 11000
670
+ },
671
+ {
672
+ "epoch": 1.49,
673
+ "learning_rate": 2.5183173390185736e-05,
674
+ "loss": 0.003,
675
+ "step": 11100
676
+ },
677
+ {
678
+ "epoch": 1.51,
679
+ "learning_rate": 2.483091664679959e-05,
680
+ "loss": 0.0016,
681
+ "step": 11200
682
+ },
683
+ {
684
+ "epoch": 1.52,
685
+ "learning_rate": 2.44786934724982e-05,
686
+ "loss": 0.0027,
687
+ "step": 11300
688
+ },
689
+ {
690
+ "epoch": 1.53,
691
+ "learning_rate": 2.4126573796162015e-05,
692
+ "loss": 0.003,
693
+ "step": 11400
694
+ },
695
+ {
696
+ "epoch": 1.55,
697
+ "learning_rate": 2.377462752612344e-05,
698
+ "loss": 0.002,
699
+ "step": 11500
700
+ },
701
+ {
702
+ "epoch": 1.56,
703
+ "learning_rate": 2.3422924536287548e-05,
704
+ "loss": 0.0026,
705
+ "step": 11600
706
+ },
707
+ {
708
+ "epoch": 1.57,
709
+ "learning_rate": 2.307153465225958e-05,
710
+ "loss": 0.0037,
711
+ "step": 11700
712
+ },
713
+ {
714
+ "epoch": 1.59,
715
+ "learning_rate": 2.272052763748209e-05,
716
+ "loss": 0.0063,
717
+ "step": 11800
718
+ },
719
+ {
720
+ "epoch": 1.6,
721
+ "learning_rate": 2.2369973179384445e-05,
722
+ "loss": 0.0046,
723
+ "step": 11900
724
+ },
725
+ {
726
+ "epoch": 1.61,
727
+ "learning_rate": 2.201994087554733e-05,
728
+ "loss": 0.0094,
729
+ "step": 12000
730
+ },
731
+ {
732
+ "epoch": 1.63,
733
+ "learning_rate": 2.167050021988514e-05,
734
+ "loss": 0.0043,
735
+ "step": 12100
736
+ },
737
+ {
738
+ "epoch": 1.64,
739
+ "learning_rate": 2.1321720588848995e-05,
740
+ "loss": 0.0024,
741
+ "step": 12200
742
+ },
743
+ {
744
+ "epoch": 1.65,
745
+ "learning_rate": 2.097367122765301e-05,
746
+ "loss": 0.0029,
747
+ "step": 12300
748
+ },
749
+ {
750
+ "epoch": 1.67,
751
+ "learning_rate": 2.0626421236526656e-05,
752
+ "loss": 0.0036,
753
+ "step": 12400
754
+ },
755
+ {
756
+ "epoch": 1.68,
757
+ "learning_rate": 2.0280039556995902e-05,
758
+ "loss": 0.0045,
759
+ "step": 12500
760
+ },
761
+ {
762
+ "epoch": 1.7,
763
+ "learning_rate": 1.9934594958195834e-05,
764
+ "loss": 0.002,
765
+ "step": 12600
766
+ },
767
+ {
768
+ "epoch": 1.71,
769
+ "learning_rate": 1.9590156023217553e-05,
770
+ "loss": 0.0039,
771
+ "step": 12700
772
+ },
773
+ {
774
+ "epoch": 1.72,
775
+ "learning_rate": 1.9246791135491982e-05,
776
+ "loss": 0.0038,
777
+ "step": 12800
778
+ },
779
+ {
780
+ "epoch": 1.74,
781
+ "learning_rate": 1.8904568465213288e-05,
782
+ "loss": 0.0015,
783
+ "step": 12900
784
+ },
785
+ {
786
+ "epoch": 1.75,
787
+ "learning_rate": 1.8563555955804683e-05,
788
+ "loss": 0.0034,
789
+ "step": 13000
790
+ },
791
+ {
792
+ "epoch": 1.76,
793
+ "learning_rate": 1.8227212109768717e-05,
794
+ "loss": 0.0047,
795
+ "step": 13100
796
+ },
797
+ {
798
+ "epoch": 1.78,
799
+ "learning_rate": 1.7888808991743948e-05,
800
+ "loss": 0.002,
801
+ "step": 13200
802
+ },
803
+ {
804
+ "epoch": 1.79,
805
+ "learning_rate": 1.7551817699124613e-05,
806
+ "loss": 0.0036,
807
+ "step": 13300
808
+ },
809
+ {
810
+ "epoch": 1.8,
811
+ "learning_rate": 1.721630513671862e-05,
812
+ "loss": 0.0055,
813
+ "step": 13400
814
+ },
815
+ {
816
+ "epoch": 1.82,
817
+ "learning_rate": 1.6882337915753093e-05,
818
+ "loss": 0.0054,
819
+ "step": 13500
820
+ },
821
+ {
822
+ "epoch": 1.83,
823
+ "learning_rate": 1.65499823406497e-05,
824
+ "loss": 0.0024,
825
+ "step": 13600
826
+ },
827
+ {
828
+ "epoch": 1.84,
829
+ "learning_rate": 1.621930439586083e-05,
830
+ "loss": 0.0057,
831
+ "step": 13700
832
+ },
833
+ {
834
+ "epoch": 1.86,
835
+ "learning_rate": 1.5890369732769356e-05,
836
+ "loss": 0.0055,
837
+ "step": 13800
838
+ },
839
+ {
840
+ "epoch": 1.87,
841
+ "learning_rate": 1.5563243656654454e-05,
842
+ "loss": 0.0025,
843
+ "step": 13900
844
+ },
845
+ {
846
+ "epoch": 1.88,
847
+ "learning_rate": 1.5237991113726185e-05,
848
+ "loss": 0.0024,
849
+ "step": 14000
850
+ },
851
+ {
852
+ "epoch": 1.9,
853
+ "learning_rate": 1.4914676678231354e-05,
854
+ "loss": 0.0037,
855
+ "step": 14100
856
+ },
857
+ {
858
+ "epoch": 1.91,
859
+ "learning_rate": 1.4593364539633242e-05,
860
+ "loss": 0.0056,
861
+ "step": 14200
862
+ },
863
+ {
864
+ "epoch": 1.92,
865
+ "learning_rate": 1.4274118489867638e-05,
866
+ "loss": 0.0017,
867
+ "step": 14300
868
+ },
869
+ {
870
+ "epoch": 1.94,
871
+ "learning_rate": 1.3957001910677942e-05,
872
+ "loss": 0.0061,
873
+ "step": 14400
874
+ },
875
+ {
876
+ "epoch": 1.95,
877
+ "learning_rate": 1.3642077761031574e-05,
878
+ "loss": 0.0011,
879
+ "step": 14500
880
+ },
881
+ {
882
+ "epoch": 1.96,
883
+ "learning_rate": 1.3329408564620358e-05,
884
+ "loss": 0.0063,
885
+ "step": 14600
886
+ },
887
+ {
888
+ "epoch": 1.98,
889
+ "learning_rate": 1.3019056397447415e-05,
890
+ "loss": 0.0005,
891
+ "step": 14700
892
+ },
893
+ {
894
+ "epoch": 1.99,
895
+ "learning_rate": 1.2711082875502745e-05,
896
+ "loss": 0.0065,
897
+ "step": 14800
898
+ },
899
+ {
900
+ "epoch": 2.0,
901
+ "learning_rate": 1.2405549142530348e-05,
902
+ "loss": 0.0019,
903
+ "step": 14900
904
+ },
905
+ {
906
+ "epoch": 2.02,
907
+ "learning_rate": 1.2102515857888976e-05,
908
+ "loss": 0.0007,
909
+ "step": 15000
910
+ }
911
+ ],
912
+ "logging_steps": 100,
913
+ "max_steps": 22296,
914
+ "num_train_epochs": 3,
915
+ "save_steps": 3000,
916
+ "total_flos": 2.415914809978061e+18,
917
+ "trial_name": null,
918
+ "trial_params": null
919
+ }
LLM-Detector-V5-11w/checkpoint-15000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34a6604f99a4d8b8974d5d75cff26a2d414536f9959193cd5fdb32762398d2f1
3
+ size 4600
LLM-Detector-V5-11w/checkpoint-18000/README.md ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: ./Qwen-14B-Chat
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
+ - **Shared by [optional]:** [More Information Needed]
22
+ - **Model type:** [More Information Needed]
23
+ - **Language(s) (NLP):** [More Information Needed]
24
+ - **License:** [More Information Needed]
25
+ - **Finetuned from model [optional]:** [More Information Needed]
26
+
27
+ ### Model Sources [optional]
28
+
29
+ <!-- Provide the basic links for the model. -->
30
+
31
+ - **Repository:** [More Information Needed]
32
+ - **Paper [optional]:** [More Information Needed]
33
+ - **Demo [optional]:** [More Information Needed]
34
+
35
+ ## Uses
36
+
37
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
38
+
39
+ ### Direct Use
40
+
41
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
42
+
43
+ [More Information Needed]
44
+
45
+ ### Downstream Use [optional]
46
+
47
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Out-of-Scope Use
52
+
53
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
54
+
55
+ [More Information Needed]
56
+
57
+ ## Bias, Risks, and Limitations
58
+
59
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ### Recommendations
64
+
65
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
66
+
67
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
68
+
69
+ ## How to Get Started with the Model
70
+
71
+ Use the code below to get started with the model.
72
+
73
+ [More Information Needed]
74
+
75
+ ## Training Details
76
+
77
+ ### Training Data
78
+
79
+ <!-- This should link to a Data 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. -->
80
+
81
+ [More Information Needed]
82
+
83
+ ### Training Procedure
84
+
85
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
86
+
87
+ #### Preprocessing [optional]
88
+
89
+ [More Information Needed]
90
+
91
+
92
+ #### Training Hyperparameters
93
+
94
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
95
+
96
+ #### Speeds, Sizes, Times [optional]
97
+
98
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
99
+
100
+ [More Information Needed]
101
+
102
+ ## Evaluation
103
+
104
+ <!-- This section describes the evaluation protocols and provides the results. -->
105
+
106
+ ### Testing Data, Factors & Metrics
107
+
108
+ #### Testing Data
109
+
110
+ <!-- This should link to a Data Card if possible. -->
111
+
112
+ [More Information Needed]
113
+
114
+ #### Factors
115
+
116
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Metrics
121
+
122
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
123
+
124
+ [More Information Needed]
125
+
126
+ ### Results
127
+
128
+ [More Information Needed]
129
+
130
+ #### Summary
131
+
132
+
133
+
134
+ ## Model Examination [optional]
135
+
136
+ <!-- Relevant interpretability work for the model goes here -->
137
+
138
+ [More Information Needed]
139
+
140
+ ## Environmental Impact
141
+
142
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
143
+
144
+ 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).
145
+
146
+ - **Hardware Type:** [More Information Needed]
147
+ - **Hours used:** [More Information Needed]
148
+ - **Cloud Provider:** [More Information Needed]
149
+ - **Compute Region:** [More Information Needed]
150
+ - **Carbon Emitted:** [More Information Needed]
151
+
152
+ ## Technical Specifications [optional]
153
+
154
+ ### Model Architecture and Objective
155
+
156
+ [More Information Needed]
157
+
158
+ ### Compute Infrastructure
159
+
160
+ [More Information Needed]
161
+
162
+ #### Hardware
163
+
164
+ [More Information Needed]
165
+
166
+ #### Software
167
+
168
+ [More Information Needed]
169
+
170
+ ## Citation [optional]
171
+
172
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
173
+
174
+ **BibTeX:**
175
+
176
+ [More Information Needed]
177
+
178
+ **APA:**
179
+
180
+ [More Information Needed]
181
+
182
+ ## Glossary [optional]
183
+
184
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
185
+
186
+ [More Information Needed]
187
+
188
+ ## More Information [optional]
189
+
190
+ [More Information Needed]
191
+
192
+ ## Model Card Authors [optional]
193
+
194
+ [More Information Needed]
195
+
196
+ ## Model Card Contact
197
+
198
+ [More Information Needed]
199
+
200
+
201
+ ## Training procedure
202
+
203
+
204
+ The following `bitsandbytes` quantization config was used during training:
205
+ - quant_method: QuantizationMethod.BITS_AND_BYTES
206
+ - load_in_8bit: False
207
+ - load_in_4bit: True
208
+ - llm_int8_threshold: 6.0
209
+ - llm_int8_skip_modules: None
210
+ - llm_int8_enable_fp32_cpu_offload: False
211
+ - llm_int8_has_fp16_weight: False
212
+ - bnb_4bit_quant_type: nf4
213
+ - bnb_4bit_use_double_quant: True
214
+ - bnb_4bit_compute_dtype: float16
215
+
216
+ ### Framework versions
217
+
218
+
219
+ - PEFT 0.6.2
LLM-Detector-V5-11w/checkpoint-18000/adapter_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "./Qwen-14B-Chat",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "lora_alpha": 16.0,
12
+ "lora_dropout": 0.1,
13
+ "modules_to_save": null,
14
+ "peft_type": "LORA",
15
+ "r": 8,
16
+ "rank_pattern": {},
17
+ "revision": null,
18
+ "target_modules": [
19
+ "c_attn"
20
+ ],
21
+ "task_type": "CAUSAL_LM"
22
+ }
LLM-Detector-V5-11w/checkpoint-18000/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b84f040810abec4b1d058fa65d87d3914a6644ff60a8b71cd9cb57516ac29e4
3
+ size 26243102
LLM-Detector-V5-11w/checkpoint-18000/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:599ef45aa70ef147baf3eed450e8ea1c1b79d43b09246edbf2d46c8dddf631a6
3
+ size 52496442
LLM-Detector-V5-11w/checkpoint-18000/qwen.tiktoken ADDED
The diff for this file is too large to render. See raw diff
 
LLM-Detector-V5-11w/checkpoint-18000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cffef474a61b5d594d02a14df6e47f6516d65561a1e6dc4f046d212671d47185
3
+ size 14244
LLM-Detector-V5-11w/checkpoint-18000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12ceeb9aa46e20b83a8a047535f01f9c43262f16f9d910408401c88cb64c2085
3
+ size 1064
LLM-Detector-V5-11w/checkpoint-18000/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_end|>"
4
+ ],
5
+ "eos_token": "<|endoftext|>",
6
+ "pad_token": "<|endoftext|>"
7
+ }
LLM-Detector-V5-11w/checkpoint-18000/tokenization_qwen.py ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Alibaba Cloud.
2
+ #
3
+ # This source code is licensed under the license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ """Tokenization classes for QWen."""
7
+
8
+ import base64
9
+ import logging
10
+ import os
11
+ import unicodedata
12
+ from typing import Collection, Dict, List, Set, Tuple, Union
13
+
14
+ import tiktoken
15
+ from transformers import PreTrainedTokenizer, AddedToken
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ VOCAB_FILES_NAMES = {"vocab_file": "qwen.tiktoken"}
21
+
22
+ PAT_STR = r"""(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}| ?[^\s\p{L}\p{N}]+[\r\n]*|\s*[\r\n]+|\s+(?!\S)|\s+"""
23
+ ENDOFTEXT = "<|endoftext|>"
24
+ IMSTART = "<|im_start|>"
25
+ IMEND = "<|im_end|>"
26
+ # as the default behavior is changed to allow special tokens in
27
+ # regular texts, the surface forms of special tokens need to be
28
+ # as different as possible to minimize the impact
29
+ EXTRAS = tuple((f"<|extra_{i}|>" for i in range(205)))
30
+ # changed to use actual index to avoid misconfiguration with vocabulary expansion
31
+ SPECIAL_START_ID = 151643
32
+ SPECIAL_TOKENS = tuple(
33
+ enumerate(
34
+ (
35
+ (
36
+ ENDOFTEXT,
37
+ IMSTART,
38
+ IMEND,
39
+ )
40
+ + EXTRAS
41
+ ),
42
+ start=SPECIAL_START_ID,
43
+ )
44
+ )
45
+ SPECIAL_TOKENS_SET = set(t for i, t in SPECIAL_TOKENS)
46
+
47
+
48
+ def _load_tiktoken_bpe(tiktoken_bpe_file: str) -> Dict[bytes, int]:
49
+ with open(tiktoken_bpe_file, "rb") as f:
50
+ contents = f.read()
51
+ return {
52
+ base64.b64decode(token): int(rank)
53
+ for token, rank in (line.split() for line in contents.splitlines() if line)
54
+ }
55
+
56
+
57
+ class QWenTokenizer(PreTrainedTokenizer):
58
+ """QWen tokenizer."""
59
+
60
+ vocab_files_names = VOCAB_FILES_NAMES
61
+
62
+ def __init__(
63
+ self,
64
+ vocab_file,
65
+ errors="replace",
66
+ extra_vocab_file=None,
67
+ **kwargs,
68
+ ):
69
+ super().__init__(**kwargs)
70
+
71
+ # how to handle errors in decoding UTF-8 byte sequences
72
+ # use ignore if you are in streaming inference
73
+ self.errors = errors
74
+
75
+ self.mergeable_ranks = _load_tiktoken_bpe(vocab_file) # type: Dict[bytes, int]
76
+ self.special_tokens = {
77
+ token: index
78
+ for index, token in SPECIAL_TOKENS
79
+ }
80
+
81
+ # try load extra vocab from file
82
+ if extra_vocab_file is not None:
83
+ used_ids = set(self.mergeable_ranks.values()) | set(self.special_tokens.values())
84
+ extra_mergeable_ranks = _load_tiktoken_bpe(extra_vocab_file)
85
+ for token, index in extra_mergeable_ranks.items():
86
+ if token in self.mergeable_ranks:
87
+ logger.info(f"extra token {token} exists, skipping")
88
+ continue
89
+ if index in used_ids:
90
+ logger.info(f'the index {index} for extra token {token} exists, skipping')
91
+ continue
92
+ self.mergeable_ranks[token] = index
93
+ # the index may be sparse after this, but don't worry tiktoken.Encoding will handle this
94
+
95
+ enc = tiktoken.Encoding(
96
+ "Qwen",
97
+ pat_str=PAT_STR,
98
+ mergeable_ranks=self.mergeable_ranks,
99
+ special_tokens=self.special_tokens,
100
+ )
101
+ assert (
102
+ len(self.mergeable_ranks) + len(self.special_tokens) == enc.n_vocab
103
+ ), f"{len(self.mergeable_ranks) + len(self.special_tokens)} != {enc.n_vocab} in encoding"
104
+
105
+ self.decoder = {
106
+ v: k for k, v in self.mergeable_ranks.items()
107
+ } # type: dict[int, bytes|str]
108
+ self.decoder.update({v: k for k, v in self.special_tokens.items()})
109
+
110
+ self.tokenizer = enc # type: tiktoken.Encoding
111
+
112
+ self.eod_id = self.tokenizer.eot_token
113
+ self.im_start_id = self.special_tokens[IMSTART]
114
+ self.im_end_id = self.special_tokens[IMEND]
115
+
116
+ def __getstate__(self):
117
+ # for pickle lovers
118
+ state = self.__dict__.copy()
119
+ del state["tokenizer"]
120
+ return state
121
+
122
+ def __setstate__(self, state):
123
+ # tokenizer is not python native; don't pass it; rebuild it
124
+ self.__dict__.update(state)
125
+ enc = tiktoken.Encoding(
126
+ "Qwen",
127
+ pat_str=PAT_STR,
128
+ mergeable_ranks=self.mergeable_ranks,
129
+ special_tokens=self.special_tokens,
130
+ )
131
+ self.tokenizer = enc
132
+
133
+ def __len__(self) -> int:
134
+ return self.tokenizer.n_vocab
135
+
136
+ def get_vocab(self) -> Dict[bytes, int]:
137
+ return self.mergeable_ranks
138
+
139
+ def convert_tokens_to_ids(
140
+ self, tokens: Union[bytes, str, List[Union[bytes, str]]]
141
+ ) -> List[int]:
142
+ ids = []
143
+ if isinstance(tokens, (str, bytes)):
144
+ if tokens in self.special_tokens:
145
+ return self.special_tokens[tokens]
146
+ else:
147
+ return self.mergeable_ranks.get(tokens)
148
+ for token in tokens:
149
+ if token in self.special_tokens:
150
+ ids.append(self.special_tokens[token])
151
+ else:
152
+ ids.append(self.mergeable_ranks.get(token))
153
+ return ids
154
+
155
+ def _add_tokens(
156
+ self,
157
+ new_tokens: Union[List[str], List[AddedToken]],
158
+ special_tokens: bool = False,
159
+ ) -> int:
160
+ if not special_tokens and new_tokens:
161
+ raise ValueError("Adding regular tokens is not supported")
162
+ for token in new_tokens:
163
+ surface_form = token.content if isinstance(token, AddedToken) else token
164
+ if surface_form not in SPECIAL_TOKENS_SET:
165
+ raise ValueError("Adding unknown special tokens is not supported")
166
+ return 0
167
+
168
+ def save_vocabulary(self, save_directory: str, **kwargs) -> Tuple[str]:
169
+ """
170
+ Save only the vocabulary of the tokenizer (vocabulary).
171
+
172
+ Returns:
173
+ `Tuple(str)`: Paths to the files saved.
174
+ """
175
+ file_path = os.path.join(save_directory, "qwen.tiktoken")
176
+ with open(file_path, "w", encoding="utf8") as w:
177
+ for k, v in self.mergeable_ranks.items():
178
+ line = base64.b64encode(k).decode("utf8") + " " + str(v) + "\n"
179
+ w.write(line)
180
+ return (file_path,)
181
+
182
+ def tokenize(
183
+ self,
184
+ text: str,
185
+ allowed_special: Union[Set, str] = "all",
186
+ disallowed_special: Union[Collection, str] = (),
187
+ **kwargs,
188
+ ) -> List[Union[bytes, str]]:
189
+ """
190
+ Converts a string in a sequence of tokens.
191
+
192
+ Args:
193
+ text (`str`):
194
+ The sequence to be encoded.
195
+ allowed_special (`Literal["all"]` or `set`):
196
+ The surface forms of the tokens to be encoded as special tokens in regular texts.
197
+ Default to "all".
198
+ disallowed_special (`Literal["all"]` or `Collection`):
199
+ The surface forms of the tokens that should not be in regular texts and trigger errors.
200
+ Default to an empty tuple.
201
+
202
+ kwargs (additional keyword arguments, *optional*):
203
+ Will be passed to the underlying model specific encode method.
204
+
205
+ Returns:
206
+ `List[bytes|str]`: The list of tokens.
207
+ """
208
+ tokens = []
209
+ text = unicodedata.normalize("NFC", text)
210
+
211
+ # this implementation takes a detour: text -> token id -> token surface forms
212
+ for t in self.tokenizer.encode(
213
+ text, allowed_special=allowed_special, disallowed_special=disallowed_special
214
+ ):
215
+ tokens.append(self.decoder[t])
216
+ return tokens
217
+
218
+ def convert_tokens_to_string(self, tokens: List[Union[bytes, str]]) -> str:
219
+ """
220
+ Converts a sequence of tokens in a single string.
221
+ """
222
+ text = ""
223
+ temp = b""
224
+ for t in tokens:
225
+ if isinstance(t, str):
226
+ if temp:
227
+ text += temp.decode("utf-8", errors=self.errors)
228
+ temp = b""
229
+ text += t
230
+ elif isinstance(t, bytes):
231
+ temp += t
232
+ else:
233
+ raise TypeError("token should only be of type types or str")
234
+ if temp:
235
+ text += temp.decode("utf-8", errors=self.errors)
236
+ return text
237
+
238
+ @property
239
+ def vocab_size(self):
240
+ return self.tokenizer.n_vocab
241
+
242
+ def _convert_id_to_token(self, index: int) -> Union[bytes, str]:
243
+ """Converts an id to a token, special tokens included"""
244
+ if index in self.decoder:
245
+ return self.decoder[index]
246
+ raise ValueError("unknown ids")
247
+
248
+ def _convert_token_to_id(self, token: Union[bytes, str]) -> int:
249
+ """Converts a token to an id using the vocab, special tokens included"""
250
+ if token in self.special_tokens:
251
+ return self.special_tokens[token]
252
+ if token in self.mergeable_ranks:
253
+ return self.mergeable_ranks[token]
254
+ raise ValueError("unknown token")
255
+
256
+ def _tokenize(self, text: str, **kwargs):
257
+ """
258
+ Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based
259
+ vocabulary or sub-words for sub-word-based vocabularies (BPE/SentencePieces/WordPieces).
260
+
261
+ Do NOT take care of added tokens.
262
+ """
263
+ raise NotImplementedError
264
+
265
+ def _decode(
266
+ self,
267
+ token_ids: Union[int, List[int]],
268
+ skip_special_tokens: bool = False,
269
+ errors: str = None,
270
+ **kwargs,
271
+ ) -> str:
272
+ if isinstance(token_ids, int):
273
+ token_ids = [token_ids]
274
+ if skip_special_tokens:
275
+ token_ids = [i for i in token_ids if i < self.eod_id]
276
+ return self.tokenizer.decode(token_ids, errors=errors or self.errors)
LLM-Detector-V5-11w/checkpoint-18000/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoTokenizer": [
4
+ "tokenization_qwen.QWenTokenizer",
5
+ null
6
+ ]
7
+ },
8
+ "clean_up_tokenization_spaces": true,
9
+ "model_max_length": 8192,
10
+ "padding_side": "right",
11
+ "split_special_tokens": false,
12
+ "tokenizer_class": "QWenTokenizer"
13
+ }
LLM-Detector-V5-11w/checkpoint-18000/trainer_state.json ADDED
@@ -0,0 +1,1099 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 2.421714708553362,
5
+ "eval_steps": 500,
6
+ "global_step": 18000,
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.01,
13
+ "learning_rate": 4.9997567688496474e-05,
14
+ "loss": 2.8699,
15
+ "step": 100
16
+ },
17
+ {
18
+ "epoch": 0.03,
19
+ "learning_rate": 4.9990172715142793e-05,
20
+ "loss": 0.0389,
21
+ "step": 200
22
+ },
23
+ {
24
+ "epoch": 0.04,
25
+ "learning_rate": 4.997781629993153e-05,
26
+ "loss": 0.0301,
27
+ "step": 300
28
+ },
29
+ {
30
+ "epoch": 0.05,
31
+ "learning_rate": 4.9960500896052476e-05,
32
+ "loss": 0.0244,
33
+ "step": 400
34
+ },
35
+ {
36
+ "epoch": 0.07,
37
+ "learning_rate": 4.993822994123172e-05,
38
+ "loss": 0.0151,
39
+ "step": 500
40
+ },
41
+ {
42
+ "epoch": 0.08,
43
+ "learning_rate": 4.9911007857049264e-05,
44
+ "loss": 0.012,
45
+ "step": 600
46
+ },
47
+ {
48
+ "epoch": 0.09,
49
+ "learning_rate": 4.987884004806111e-05,
50
+ "loss": 0.0268,
51
+ "step": 700
52
+ },
53
+ {
54
+ "epoch": 0.11,
55
+ "learning_rate": 4.984173290072626e-05,
56
+ "loss": 0.0187,
57
+ "step": 800
58
+ },
59
+ {
60
+ "epoch": 0.12,
61
+ "learning_rate": 4.979969378213884e-05,
62
+ "loss": 0.0166,
63
+ "step": 900
64
+ },
65
+ {
66
+ "epoch": 0.13,
67
+ "learning_rate": 4.975273103856537e-05,
68
+ "loss": 0.022,
69
+ "step": 1000
70
+ },
71
+ {
72
+ "epoch": 0.15,
73
+ "learning_rate": 4.970085399378785e-05,
74
+ "loss": 0.0194,
75
+ "step": 1100
76
+ },
77
+ {
78
+ "epoch": 0.16,
79
+ "learning_rate": 4.964407294725254e-05,
80
+ "loss": 0.0182,
81
+ "step": 1200
82
+ },
83
+ {
84
+ "epoch": 0.17,
85
+ "learning_rate": 4.958239917202523e-05,
86
+ "loss": 0.0204,
87
+ "step": 1300
88
+ },
89
+ {
90
+ "epoch": 0.19,
91
+ "learning_rate": 4.9515844912553106e-05,
92
+ "loss": 0.013,
93
+ "step": 1400
94
+ },
95
+ {
96
+ "epoch": 0.2,
97
+ "learning_rate": 4.944442338223378e-05,
98
+ "loss": 0.0107,
99
+ "step": 1500
100
+ },
101
+ {
102
+ "epoch": 0.22,
103
+ "learning_rate": 4.9368148760792e-05,
104
+ "loss": 0.0156,
105
+ "step": 1600
106
+ },
107
+ {
108
+ "epoch": 0.23,
109
+ "learning_rate": 4.9287036191464414e-05,
110
+ "loss": 0.0141,
111
+ "step": 1700
112
+ },
113
+ {
114
+ "epoch": 0.24,
115
+ "learning_rate": 4.9201101777993116e-05,
116
+ "loss": 0.0104,
117
+ "step": 1800
118
+ },
119
+ {
120
+ "epoch": 0.26,
121
+ "learning_rate": 4.911036258142853e-05,
122
+ "loss": 0.0087,
123
+ "step": 1900
124
+ },
125
+ {
126
+ "epoch": 0.27,
127
+ "learning_rate": 4.9014836616742065e-05,
128
+ "loss": 0.013,
129
+ "step": 2000
130
+ },
131
+ {
132
+ "epoch": 0.28,
133
+ "learning_rate": 4.891454284924965e-05,
134
+ "loss": 0.0194,
135
+ "step": 2100
136
+ },
137
+ {
138
+ "epoch": 0.3,
139
+ "learning_rate": 4.8809501190846284e-05,
140
+ "loss": 0.0131,
141
+ "step": 2200
142
+ },
143
+ {
144
+ "epoch": 0.31,
145
+ "learning_rate": 4.8699732496052965e-05,
146
+ "loss": 0.0135,
147
+ "step": 2300
148
+ },
149
+ {
150
+ "epoch": 0.32,
151
+ "learning_rate": 4.858525855787619e-05,
152
+ "loss": 0.0106,
153
+ "step": 2400
154
+ },
155
+ {
156
+ "epoch": 0.34,
157
+ "learning_rate": 4.846610210348137e-05,
158
+ "loss": 0.0089,
159
+ "step": 2500
160
+ },
161
+ {
162
+ "epoch": 0.35,
163
+ "learning_rate": 4.8342286789680605e-05,
164
+ "loss": 0.0086,
165
+ "step": 2600
166
+ },
167
+ {
168
+ "epoch": 0.36,
169
+ "learning_rate": 4.8213837198235996e-05,
170
+ "loss": 0.0035,
171
+ "step": 2700
172
+ },
173
+ {
174
+ "epoch": 0.38,
175
+ "learning_rate": 4.8080778830979276e-05,
176
+ "loss": 0.0121,
177
+ "step": 2800
178
+ },
179
+ {
180
+ "epoch": 0.39,
181
+ "learning_rate": 4.794313810474878e-05,
182
+ "loss": 0.0146,
183
+ "step": 2900
184
+ },
185
+ {
186
+ "epoch": 0.4,
187
+ "learning_rate": 4.780094234614479e-05,
188
+ "loss": 0.0047,
189
+ "step": 3000
190
+ },
191
+ {
192
+ "epoch": 0.42,
193
+ "learning_rate": 4.765421978610418e-05,
194
+ "loss": 0.0096,
195
+ "step": 3100
196
+ },
197
+ {
198
+ "epoch": 0.43,
199
+ "learning_rate": 4.750299955429562e-05,
200
+ "loss": 0.0116,
201
+ "step": 3200
202
+ },
203
+ {
204
+ "epoch": 0.44,
205
+ "learning_rate": 4.734731167333625e-05,
206
+ "loss": 0.0192,
207
+ "step": 3300
208
+ },
209
+ {
210
+ "epoch": 0.46,
211
+ "learning_rate": 4.718718705283113e-05,
212
+ "loss": 0.0111,
213
+ "step": 3400
214
+ },
215
+ {
216
+ "epoch": 0.47,
217
+ "learning_rate": 4.702265748323661e-05,
218
+ "loss": 0.0114,
219
+ "step": 3500
220
+ },
221
+ {
222
+ "epoch": 0.48,
223
+ "learning_rate": 4.685375562954876e-05,
224
+ "loss": 0.0113,
225
+ "step": 3600
226
+ },
227
+ {
228
+ "epoch": 0.5,
229
+ "learning_rate": 4.668051502481818e-05,
230
+ "loss": 0.0097,
231
+ "step": 3700
232
+ },
233
+ {
234
+ "epoch": 0.51,
235
+ "learning_rate": 4.650297006349257e-05,
236
+ "loss": 0.0094,
237
+ "step": 3800
238
+ },
239
+ {
240
+ "epoch": 0.52,
241
+ "learning_rate": 4.63211559945881e-05,
242
+ "loss": 0.0059,
243
+ "step": 3900
244
+ },
245
+ {
246
+ "epoch": 0.54,
247
+ "learning_rate": 4.613699021830524e-05,
248
+ "loss": 0.0195,
249
+ "step": 4000
250
+ },
251
+ {
252
+ "epoch": 0.55,
253
+ "learning_rate": 4.59467888395669e-05,
254
+ "loss": 0.0088,
255
+ "step": 4100
256
+ },
257
+ {
258
+ "epoch": 0.57,
259
+ "learning_rate": 4.575242877508777e-05,
260
+ "loss": 0.0087,
261
+ "step": 4200
262
+ },
263
+ {
264
+ "epoch": 0.58,
265
+ "learning_rate": 4.5553948612282607e-05,
266
+ "loss": 0.0088,
267
+ "step": 4300
268
+ },
269
+ {
270
+ "epoch": 0.59,
271
+ "learning_rate": 4.5351387756552846e-05,
272
+ "loss": 0.0122,
273
+ "step": 4400
274
+ },
275
+ {
276
+ "epoch": 0.61,
277
+ "learning_rate": 4.51447864234632e-05,
278
+ "loss": 0.0081,
279
+ "step": 4500
280
+ },
281
+ {
282
+ "epoch": 0.62,
283
+ "learning_rate": 4.4934185630757484e-05,
284
+ "loss": 0.0079,
285
+ "step": 4600
286
+ },
287
+ {
288
+ "epoch": 0.63,
289
+ "learning_rate": 4.4719627190215064e-05,
290
+ "loss": 0.011,
291
+ "step": 4700
292
+ },
293
+ {
294
+ "epoch": 0.65,
295
+ "learning_rate": 4.450115369934976e-05,
296
+ "loss": 0.0146,
297
+ "step": 4800
298
+ },
299
+ {
300
+ "epoch": 0.66,
301
+ "learning_rate": 4.427880853295274e-05,
302
+ "loss": 0.0057,
303
+ "step": 4900
304
+ },
305
+ {
306
+ "epoch": 0.67,
307
+ "learning_rate": 4.4052635834481025e-05,
308
+ "loss": 0.0051,
309
+ "step": 5000
310
+ },
311
+ {
312
+ "epoch": 0.69,
313
+ "learning_rate": 4.3822680507293455e-05,
314
+ "loss": 0.006,
315
+ "step": 5100
316
+ },
317
+ {
318
+ "epoch": 0.7,
319
+ "learning_rate": 4.358898820573581e-05,
320
+ "loss": 0.0127,
321
+ "step": 5200
322
+ },
323
+ {
324
+ "epoch": 0.71,
325
+ "learning_rate": 4.3351605326076724e-05,
326
+ "loss": 0.0062,
327
+ "step": 5300
328
+ },
329
+ {
330
+ "epoch": 0.73,
331
+ "learning_rate": 4.3110578997296416e-05,
332
+ "loss": 0.0157,
333
+ "step": 5400
334
+ },
335
+ {
336
+ "epoch": 0.74,
337
+ "learning_rate": 4.286595707172986e-05,
338
+ "loss": 0.0111,
339
+ "step": 5500
340
+ },
341
+ {
342
+ "epoch": 0.75,
343
+ "learning_rate": 4.261778811556646e-05,
344
+ "loss": 0.0141,
345
+ "step": 5600
346
+ },
347
+ {
348
+ "epoch": 0.77,
349
+ "learning_rate": 4.236612139920786e-05,
350
+ "loss": 0.0093,
351
+ "step": 5700
352
+ },
353
+ {
354
+ "epoch": 0.78,
355
+ "learning_rate": 4.2111006887486035e-05,
356
+ "loss": 0.0091,
357
+ "step": 5800
358
+ },
359
+ {
360
+ "epoch": 0.79,
361
+ "learning_rate": 4.185249522974346e-05,
362
+ "loss": 0.0043,
363
+ "step": 5900
364
+ },
365
+ {
366
+ "epoch": 0.81,
367
+ "learning_rate": 4.159063774977748e-05,
368
+ "loss": 0.0072,
369
+ "step": 6000
370
+ },
371
+ {
372
+ "epoch": 0.82,
373
+ "learning_rate": 4.1325486435650625e-05,
374
+ "loss": 0.0063,
375
+ "step": 6100
376
+ },
377
+ {
378
+ "epoch": 0.83,
379
+ "learning_rate": 4.105709392936914e-05,
380
+ "loss": 0.005,
381
+ "step": 6200
382
+ },
383
+ {
384
+ "epoch": 0.85,
385
+ "learning_rate": 4.0785513516431705e-05,
386
+ "loss": 0.0167,
387
+ "step": 6300
388
+ },
389
+ {
390
+ "epoch": 0.86,
391
+ "learning_rate": 4.051079911525031e-05,
392
+ "loss": 0.0068,
393
+ "step": 6400
394
+ },
395
+ {
396
+ "epoch": 0.87,
397
+ "learning_rate": 4.023300526644557e-05,
398
+ "loss": 0.0076,
399
+ "step": 6500
400
+ },
401
+ {
402
+ "epoch": 0.89,
403
+ "learning_rate": 3.9952187122018435e-05,
404
+ "loss": 0.0123,
405
+ "step": 6600
406
+ },
407
+ {
408
+ "epoch": 0.9,
409
+ "learning_rate": 3.966840043440054e-05,
410
+ "loss": 0.0074,
411
+ "step": 6700
412
+ },
413
+ {
414
+ "epoch": 0.91,
415
+ "learning_rate": 3.9381701545385384e-05,
416
+ "loss": 0.0045,
417
+ "step": 6800
418
+ },
419
+ {
420
+ "epoch": 0.93,
421
+ "learning_rate": 3.9092147374942454e-05,
422
+ "loss": 0.0141,
423
+ "step": 6900
424
+ },
425
+ {
426
+ "epoch": 0.94,
427
+ "learning_rate": 3.87997954099166e-05,
428
+ "loss": 0.0036,
429
+ "step": 7000
430
+ },
431
+ {
432
+ "epoch": 0.96,
433
+ "learning_rate": 3.8504703692614795e-05,
434
+ "loss": 0.0077,
435
+ "step": 7100
436
+ },
437
+ {
438
+ "epoch": 0.97,
439
+ "learning_rate": 3.820693080928271e-05,
440
+ "loss": 0.0063,
441
+ "step": 7200
442
+ },
443
+ {
444
+ "epoch": 0.98,
445
+ "learning_rate": 3.790653587847325e-05,
446
+ "loss": 0.0078,
447
+ "step": 7300
448
+ },
449
+ {
450
+ "epoch": 1.0,
451
+ "learning_rate": 3.760357853930936e-05,
452
+ "loss": 0.004,
453
+ "step": 7400
454
+ },
455
+ {
456
+ "epoch": 1.01,
457
+ "learning_rate": 3.72981189396436e-05,
458
+ "loss": 0.003,
459
+ "step": 7500
460
+ },
461
+ {
462
+ "epoch": 1.02,
463
+ "learning_rate": 3.699021772411661e-05,
464
+ "loss": 0.0064,
465
+ "step": 7600
466
+ },
467
+ {
468
+ "epoch": 1.04,
469
+ "learning_rate": 3.667993602211695e-05,
470
+ "loss": 0.0047,
471
+ "step": 7700
472
+ },
473
+ {
474
+ "epoch": 1.05,
475
+ "learning_rate": 3.636733543564481e-05,
476
+ "loss": 0.0031,
477
+ "step": 7800
478
+ },
479
+ {
480
+ "epoch": 1.06,
481
+ "learning_rate": 3.605247802708175e-05,
482
+ "loss": 0.0015,
483
+ "step": 7900
484
+ },
485
+ {
486
+ "epoch": 1.08,
487
+ "learning_rate": 3.5735426306869135e-05,
488
+ "loss": 0.0103,
489
+ "step": 8000
490
+ },
491
+ {
492
+ "epoch": 1.09,
493
+ "learning_rate": 3.5416243221097553e-05,
494
+ "loss": 0.0062,
495
+ "step": 8100
496
+ },
497
+ {
498
+ "epoch": 1.1,
499
+ "learning_rate": 3.509499213900977e-05,
500
+ "loss": 0.0046,
501
+ "step": 8200
502
+ },
503
+ {
504
+ "epoch": 1.12,
505
+ "learning_rate": 3.477497910387336e-05,
506
+ "loss": 0.0082,
507
+ "step": 8300
508
+ },
509
+ {
510
+ "epoch": 1.13,
511
+ "learning_rate": 3.44498028479363e-05,
512
+ "loss": 0.0065,
513
+ "step": 8400
514
+ },
515
+ {
516
+ "epoch": 1.14,
517
+ "learning_rate": 3.412275046861546e-05,
518
+ "loss": 0.0025,
519
+ "step": 8500
520
+ },
521
+ {
522
+ "epoch": 1.16,
523
+ "learning_rate": 3.379388689748946e-05,
524
+ "loss": 0.0047,
525
+ "step": 8600
526
+ },
527
+ {
528
+ "epoch": 1.17,
529
+ "learning_rate": 3.346327742572318e-05,
530
+ "loss": 0.0028,
531
+ "step": 8700
532
+ },
533
+ {
534
+ "epoch": 1.18,
535
+ "learning_rate": 3.3130987691105155e-05,
536
+ "loss": 0.0037,
537
+ "step": 8800
538
+ },
539
+ {
540
+ "epoch": 1.2,
541
+ "learning_rate": 3.279708366501608e-05,
542
+ "loss": 0.0067,
543
+ "step": 8900
544
+ },
545
+ {
546
+ "epoch": 1.21,
547
+ "learning_rate": 3.246163163933119e-05,
548
+ "loss": 0.0045,
549
+ "step": 9000
550
+ },
551
+ {
552
+ "epoch": 1.22,
553
+ "learning_rate": 3.2124698213258904e-05,
554
+ "loss": 0.0038,
555
+ "step": 9100
556
+ },
557
+ {
558
+ "epoch": 1.24,
559
+ "learning_rate": 3.178635028011855e-05,
560
+ "loss": 0.0103,
561
+ "step": 9200
562
+ },
563
+ {
564
+ "epoch": 1.25,
565
+ "learning_rate": 3.144665501405963e-05,
566
+ "loss": 0.0061,
567
+ "step": 9300
568
+ },
569
+ {
570
+ "epoch": 1.26,
571
+ "learning_rate": 3.110567985672535e-05,
572
+ "loss": 0.0042,
573
+ "step": 9400
574
+ },
575
+ {
576
+ "epoch": 1.28,
577
+ "learning_rate": 3.076349250386302e-05,
578
+ "loss": 0.0058,
579
+ "step": 9500
580
+ },
581
+ {
582
+ "epoch": 1.29,
583
+ "learning_rate": 3.0420160891884115e-05,
584
+ "loss": 0.0077,
585
+ "step": 9600
586
+ },
587
+ {
588
+ "epoch": 1.31,
589
+ "learning_rate": 3.0075753184376354e-05,
590
+ "loss": 0.0036,
591
+ "step": 9700
592
+ },
593
+ {
594
+ "epoch": 1.32,
595
+ "learning_rate": 2.9730337758570913e-05,
596
+ "loss": 0.007,
597
+ "step": 9800
598
+ },
599
+ {
600
+ "epoch": 1.33,
601
+ "learning_rate": 2.938398319176699e-05,
602
+ "loss": 0.0073,
603
+ "step": 9900
604
+ },
605
+ {
606
+ "epoch": 1.35,
607
+ "learning_rate": 2.903675824771684e-05,
608
+ "loss": 0.0053,
609
+ "step": 10000
610
+ },
611
+ {
612
+ "epoch": 1.36,
613
+ "learning_rate": 2.8688731862973677e-05,
614
+ "loss": 0.0074,
615
+ "step": 10100
616
+ },
617
+ {
618
+ "epoch": 1.37,
619
+ "learning_rate": 2.833997313320535e-05,
620
+ "loss": 0.004,
621
+ "step": 10200
622
+ },
623
+ {
624
+ "epoch": 1.39,
625
+ "learning_rate": 2.799055129947631e-05,
626
+ "loss": 0.003,
627
+ "step": 10300
628
+ },
629
+ {
630
+ "epoch": 1.4,
631
+ "learning_rate": 2.7644038601038813e-05,
632
+ "loss": 0.0061,
633
+ "step": 10400
634
+ },
635
+ {
636
+ "epoch": 1.41,
637
+ "learning_rate": 2.7293503693483008e-05,
638
+ "loss": 0.0044,
639
+ "step": 10500
640
+ },
641
+ {
642
+ "epoch": 1.43,
643
+ "learning_rate": 2.6942513443527008e-05,
644
+ "loss": 0.0029,
645
+ "step": 10600
646
+ },
647
+ {
648
+ "epoch": 1.44,
649
+ "learning_rate": 2.6591137535271742e-05,
650
+ "loss": 0.001,
651
+ "step": 10700
652
+ },
653
+ {
654
+ "epoch": 1.45,
655
+ "learning_rate": 2.6239445729385104e-05,
656
+ "loss": 0.0047,
657
+ "step": 10800
658
+ },
659
+ {
660
+ "epoch": 1.47,
661
+ "learning_rate": 2.5887507849251914e-05,
662
+ "loss": 0.005,
663
+ "step": 10900
664
+ },
665
+ {
666
+ "epoch": 1.48,
667
+ "learning_rate": 2.5535393767111533e-05,
668
+ "loss": 0.0023,
669
+ "step": 11000
670
+ },
671
+ {
672
+ "epoch": 1.49,
673
+ "learning_rate": 2.5183173390185736e-05,
674
+ "loss": 0.003,
675
+ "step": 11100
676
+ },
677
+ {
678
+ "epoch": 1.51,
679
+ "learning_rate": 2.483091664679959e-05,
680
+ "loss": 0.0016,
681
+ "step": 11200
682
+ },
683
+ {
684
+ "epoch": 1.52,
685
+ "learning_rate": 2.44786934724982e-05,
686
+ "loss": 0.0027,
687
+ "step": 11300
688
+ },
689
+ {
690
+ "epoch": 1.53,
691
+ "learning_rate": 2.4126573796162015e-05,
692
+ "loss": 0.003,
693
+ "step": 11400
694
+ },
695
+ {
696
+ "epoch": 1.55,
697
+ "learning_rate": 2.377462752612344e-05,
698
+ "loss": 0.002,
699
+ "step": 11500
700
+ },
701
+ {
702
+ "epoch": 1.56,
703
+ "learning_rate": 2.3422924536287548e-05,
704
+ "loss": 0.0026,
705
+ "step": 11600
706
+ },
707
+ {
708
+ "epoch": 1.57,
709
+ "learning_rate": 2.307153465225958e-05,
710
+ "loss": 0.0037,
711
+ "step": 11700
712
+ },
713
+ {
714
+ "epoch": 1.59,
715
+ "learning_rate": 2.272052763748209e-05,
716
+ "loss": 0.0063,
717
+ "step": 11800
718
+ },
719
+ {
720
+ "epoch": 1.6,
721
+ "learning_rate": 2.2369973179384445e-05,
722
+ "loss": 0.0046,
723
+ "step": 11900
724
+ },
725
+ {
726
+ "epoch": 1.61,
727
+ "learning_rate": 2.201994087554733e-05,
728
+ "loss": 0.0094,
729
+ "step": 12000
730
+ },
731
+ {
732
+ "epoch": 1.63,
733
+ "learning_rate": 2.167050021988514e-05,
734
+ "loss": 0.0043,
735
+ "step": 12100
736
+ },
737
+ {
738
+ "epoch": 1.64,
739
+ "learning_rate": 2.1321720588848995e-05,
740
+ "loss": 0.0024,
741
+ "step": 12200
742
+ },
743
+ {
744
+ "epoch": 1.65,
745
+ "learning_rate": 2.097367122765301e-05,
746
+ "loss": 0.0029,
747
+ "step": 12300
748
+ },
749
+ {
750
+ "epoch": 1.67,
751
+ "learning_rate": 2.0626421236526656e-05,
752
+ "loss": 0.0036,
753
+ "step": 12400
754
+ },
755
+ {
756
+ "epoch": 1.68,
757
+ "learning_rate": 2.0280039556995902e-05,
758
+ "loss": 0.0045,
759
+ "step": 12500
760
+ },
761
+ {
762
+ "epoch": 1.7,
763
+ "learning_rate": 1.9934594958195834e-05,
764
+ "loss": 0.002,
765
+ "step": 12600
766
+ },
767
+ {
768
+ "epoch": 1.71,
769
+ "learning_rate": 1.9590156023217553e-05,
770
+ "loss": 0.0039,
771
+ "step": 12700
772
+ },
773
+ {
774
+ "epoch": 1.72,
775
+ "learning_rate": 1.9246791135491982e-05,
776
+ "loss": 0.0038,
777
+ "step": 12800
778
+ },
779
+ {
780
+ "epoch": 1.74,
781
+ "learning_rate": 1.8904568465213288e-05,
782
+ "loss": 0.0015,
783
+ "step": 12900
784
+ },
785
+ {
786
+ "epoch": 1.75,
787
+ "learning_rate": 1.8563555955804683e-05,
788
+ "loss": 0.0034,
789
+ "step": 13000
790
+ },
791
+ {
792
+ "epoch": 1.76,
793
+ "learning_rate": 1.8227212109768717e-05,
794
+ "loss": 0.0047,
795
+ "step": 13100
796
+ },
797
+ {
798
+ "epoch": 1.78,
799
+ "learning_rate": 1.7888808991743948e-05,
800
+ "loss": 0.002,
801
+ "step": 13200
802
+ },
803
+ {
804
+ "epoch": 1.79,
805
+ "learning_rate": 1.7551817699124613e-05,
806
+ "loss": 0.0036,
807
+ "step": 13300
808
+ },
809
+ {
810
+ "epoch": 1.8,
811
+ "learning_rate": 1.721630513671862e-05,
812
+ "loss": 0.0055,
813
+ "step": 13400
814
+ },
815
+ {
816
+ "epoch": 1.82,
817
+ "learning_rate": 1.6882337915753093e-05,
818
+ "loss": 0.0054,
819
+ "step": 13500
820
+ },
821
+ {
822
+ "epoch": 1.83,
823
+ "learning_rate": 1.65499823406497e-05,
824
+ "loss": 0.0024,
825
+ "step": 13600
826
+ },
827
+ {
828
+ "epoch": 1.84,
829
+ "learning_rate": 1.621930439586083e-05,
830
+ "loss": 0.0057,
831
+ "step": 13700
832
+ },
833
+ {
834
+ "epoch": 1.86,
835
+ "learning_rate": 1.5890369732769356e-05,
836
+ "loss": 0.0055,
837
+ "step": 13800
838
+ },
839
+ {
840
+ "epoch": 1.87,
841
+ "learning_rate": 1.5563243656654454e-05,
842
+ "loss": 0.0025,
843
+ "step": 13900
844
+ },
845
+ {
846
+ "epoch": 1.88,
847
+ "learning_rate": 1.5237991113726185e-05,
848
+ "loss": 0.0024,
849
+ "step": 14000
850
+ },
851
+ {
852
+ "epoch": 1.9,
853
+ "learning_rate": 1.4914676678231354e-05,
854
+ "loss": 0.0037,
855
+ "step": 14100
856
+ },
857
+ {
858
+ "epoch": 1.91,
859
+ "learning_rate": 1.4593364539633242e-05,
860
+ "loss": 0.0056,
861
+ "step": 14200
862
+ },
863
+ {
864
+ "epoch": 1.92,
865
+ "learning_rate": 1.4274118489867638e-05,
866
+ "loss": 0.0017,
867
+ "step": 14300
868
+ },
869
+ {
870
+ "epoch": 1.94,
871
+ "learning_rate": 1.3957001910677942e-05,
872
+ "loss": 0.0061,
873
+ "step": 14400
874
+ },
875
+ {
876
+ "epoch": 1.95,
877
+ "learning_rate": 1.3642077761031574e-05,
878
+ "loss": 0.0011,
879
+ "step": 14500
880
+ },
881
+ {
882
+ "epoch": 1.96,
883
+ "learning_rate": 1.3329408564620358e-05,
884
+ "loss": 0.0063,
885
+ "step": 14600
886
+ },
887
+ {
888
+ "epoch": 1.98,
889
+ "learning_rate": 1.3019056397447415e-05,
890
+ "loss": 0.0005,
891
+ "step": 14700
892
+ },
893
+ {
894
+ "epoch": 1.99,
895
+ "learning_rate": 1.2711082875502745e-05,
896
+ "loss": 0.0065,
897
+ "step": 14800
898
+ },
899
+ {
900
+ "epoch": 2.0,
901
+ "learning_rate": 1.2405549142530348e-05,
902
+ "loss": 0.0019,
903
+ "step": 14900
904
+ },
905
+ {
906
+ "epoch": 2.02,
907
+ "learning_rate": 1.2102515857888976e-05,
908
+ "loss": 0.0007,
909
+ "step": 15000
910
+ },
911
+ {
912
+ "epoch": 2.03,
913
+ "learning_rate": 1.1802043184509044e-05,
914
+ "loss": 0.0008,
915
+ "step": 15100
916
+ },
917
+ {
918
+ "epoch": 2.05,
919
+ "learning_rate": 1.1504190776948205e-05,
920
+ "loss": 0.0018,
921
+ "step": 15200
922
+ },
923
+ {
924
+ "epoch": 2.06,
925
+ "learning_rate": 1.1209017769547758e-05,
926
+ "loss": 0.0002,
927
+ "step": 15300
928
+ },
929
+ {
930
+ "epoch": 2.07,
931
+ "learning_rate": 1.0916582764692346e-05,
932
+ "loss": 0.0009,
933
+ "step": 15400
934
+ },
935
+ {
936
+ "epoch": 2.09,
937
+ "learning_rate": 1.062694382117534e-05,
938
+ "loss": 0.0003,
939
+ "step": 15500
940
+ },
941
+ {
942
+ "epoch": 2.1,
943
+ "learning_rate": 1.0340158442672049e-05,
944
+ "loss": 0.0018,
945
+ "step": 15600
946
+ },
947
+ {
948
+ "epoch": 2.11,
949
+ "learning_rate": 1.0056283566323224e-05,
950
+ "loss": 0.0053,
951
+ "step": 15700
952
+ },
953
+ {
954
+ "epoch": 2.13,
955
+ "learning_rate": 9.77537555143098e-06,
956
+ "loss": 0.0005,
957
+ "step": 15800
958
+ },
959
+ {
960
+ "epoch": 2.14,
961
+ "learning_rate": 9.497490168269444e-06,
962
+ "loss": 0.0009,
963
+ "step": 15900
964
+ },
965
+ {
966
+ "epoch": 2.15,
967
+ "learning_rate": 9.222682587012408e-06,
968
+ "loss": 0.0018,
969
+ "step": 16000
970
+ },
971
+ {
972
+ "epoch": 2.17,
973
+ "learning_rate": 8.951007366780059e-06,
974
+ "loss": 0.0003,
975
+ "step": 16100
976
+ },
977
+ {
978
+ "epoch": 2.18,
979
+ "learning_rate": 8.682518444807017e-06,
980
+ "loss": 0.0003,
981
+ "step": 16200
982
+ },
983
+ {
984
+ "epoch": 2.19,
985
+ "learning_rate": 8.417269125733923e-06,
986
+ "loss": 0.0023,
987
+ "step": 16300
988
+ },
989
+ {
990
+ "epoch": 2.21,
991
+ "learning_rate": 8.155312071024505e-06,
992
+ "loss": 0.0008,
993
+ "step": 16400
994
+ },
995
+ {
996
+ "epoch": 2.22,
997
+ "learning_rate": 7.896699288510437e-06,
998
+ "loss": 0.0002,
999
+ "step": 16500
1000
+ },
1001
+ {
1002
+ "epoch": 2.23,
1003
+ "learning_rate": 7.64148212206594e-06,
1004
+ "loss": 0.0009,
1005
+ "step": 16600
1006
+ },
1007
+ {
1008
+ "epoch": 2.25,
1009
+ "learning_rate": 7.389711241414119e-06,
1010
+ "loss": 0.0003,
1011
+ "step": 16700
1012
+ },
1013
+ {
1014
+ "epoch": 2.26,
1015
+ "learning_rate": 7.141436632067294e-06,
1016
+ "loss": 0.0001,
1017
+ "step": 16800
1018
+ },
1019
+ {
1020
+ "epoch": 2.27,
1021
+ "learning_rate": 6.896707585403029e-06,
1022
+ "loss": 0.0006,
1023
+ "step": 16900
1024
+ },
1025
+ {
1026
+ "epoch": 2.29,
1027
+ "learning_rate": 6.655572688878073e-06,
1028
+ "loss": 0.0009,
1029
+ "step": 17000
1030
+ },
1031
+ {
1032
+ "epoch": 2.3,
1033
+ "learning_rate": 6.4180798163820085e-06,
1034
+ "loss": 0.0002,
1035
+ "step": 17100
1036
+ },
1037
+ {
1038
+ "epoch": 2.31,
1039
+ "learning_rate": 6.184276118732538e-06,
1040
+ "loss": 0.0009,
1041
+ "step": 17200
1042
+ },
1043
+ {
1044
+ "epoch": 2.33,
1045
+ "learning_rate": 5.954208014314419e-06,
1046
+ "loss": 0.0018,
1047
+ "step": 17300
1048
+ },
1049
+ {
1050
+ "epoch": 2.34,
1051
+ "learning_rate": 5.727921179863712e-06,
1052
+ "loss": 0.0014,
1053
+ "step": 17400
1054
+ },
1055
+ {
1056
+ "epoch": 2.35,
1057
+ "learning_rate": 5.505460541399343e-06,
1058
+ "loss": 0.0006,
1059
+ "step": 17500
1060
+ },
1061
+ {
1062
+ "epoch": 2.37,
1063
+ "learning_rate": 5.286870265303676e-06,
1064
+ "loss": 0.0,
1065
+ "step": 17600
1066
+ },
1067
+ {
1068
+ "epoch": 2.38,
1069
+ "learning_rate": 5.074321001003329e-06,
1070
+ "loss": 0.0004,
1071
+ "step": 17700
1072
+ },
1073
+ {
1074
+ "epoch": 2.39,
1075
+ "learning_rate": 4.863561094340846e-06,
1076
+ "loss": 0.0005,
1077
+ "step": 17800
1078
+ },
1079
+ {
1080
+ "epoch": 2.41,
1081
+ "learning_rate": 4.656798990014011e-06,
1082
+ "loss": 0.0026,
1083
+ "step": 17900
1084
+ },
1085
+ {
1086
+ "epoch": 2.42,
1087
+ "learning_rate": 4.454075737685456e-06,
1088
+ "loss": 0.0002,
1089
+ "step": 18000
1090
+ }
1091
+ ],
1092
+ "logging_steps": 100,
1093
+ "max_steps": 22296,
1094
+ "num_train_epochs": 3,
1095
+ "save_steps": 3000,
1096
+ "total_flos": 2.899990453107917e+18,
1097
+ "trial_name": null,
1098
+ "trial_params": null
1099
+ }
LLM-Detector-V5-11w/checkpoint-18000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34a6604f99a4d8b8974d5d75cff26a2d414536f9959193cd5fdb32762398d2f1
3
+ size 4600
LLM-Detector-V5-11w/checkpoint-21000/README.md ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: ./Qwen-14B-Chat
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
+ - **Shared by [optional]:** [More Information Needed]
22
+ - **Model type:** [More Information Needed]
23
+ - **Language(s) (NLP):** [More Information Needed]
24
+ - **License:** [More Information Needed]
25
+ - **Finetuned from model [optional]:** [More Information Needed]
26
+
27
+ ### Model Sources [optional]
28
+
29
+ <!-- Provide the basic links for the model. -->
30
+
31
+ - **Repository:** [More Information Needed]
32
+ - **Paper [optional]:** [More Information Needed]
33
+ - **Demo [optional]:** [More Information Needed]
34
+
35
+ ## Uses
36
+
37
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
38
+
39
+ ### Direct Use
40
+
41
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
42
+
43
+ [More Information Needed]
44
+
45
+ ### Downstream Use [optional]
46
+
47
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
48
+
49
+ [More Information Needed]
50
+
51
+ ### Out-of-Scope Use
52
+
53
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
54
+
55
+ [More Information Needed]
56
+
57
+ ## Bias, Risks, and Limitations
58
+
59
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
60
+
61
+ [More Information Needed]
62
+
63
+ ### Recommendations
64
+
65
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
66
+
67
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
68
+
69
+ ## How to Get Started with the Model
70
+
71
+ Use the code below to get started with the model.
72
+
73
+ [More Information Needed]
74
+
75
+ ## Training Details
76
+
77
+ ### Training Data
78
+
79
+ <!-- This should link to a Data 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. -->
80
+
81
+ [More Information Needed]
82
+
83
+ ### Training Procedure
84
+
85
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
86
+
87
+ #### Preprocessing [optional]
88
+
89
+ [More Information Needed]
90
+
91
+
92
+ #### Training Hyperparameters
93
+
94
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
95
+
96
+ #### Speeds, Sizes, Times [optional]
97
+
98
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
99
+
100
+ [More Information Needed]
101
+
102
+ ## Evaluation
103
+
104
+ <!-- This section describes the evaluation protocols and provides the results. -->
105
+
106
+ ### Testing Data, Factors & Metrics
107
+
108
+ #### Testing Data
109
+
110
+ <!-- This should link to a Data Card if possible. -->
111
+
112
+ [More Information Needed]
113
+
114
+ #### Factors
115
+
116
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
117
+
118
+ [More Information Needed]
119
+
120
+ #### Metrics
121
+
122
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
123
+
124
+ [More Information Needed]
125
+
126
+ ### Results
127
+
128
+ [More Information Needed]
129
+
130
+ #### Summary
131
+
132
+
133
+
134
+ ## Model Examination [optional]
135
+
136
+ <!-- Relevant interpretability work for the model goes here -->
137
+
138
+ [More Information Needed]
139
+
140
+ ## Environmental Impact
141
+
142
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
143
+
144
+ 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).
145
+
146
+ - **Hardware Type:** [More Information Needed]
147
+ - **Hours used:** [More Information Needed]
148
+ - **Cloud Provider:** [More Information Needed]
149
+ - **Compute Region:** [More Information Needed]
150
+ - **Carbon Emitted:** [More Information Needed]
151
+
152
+ ## Technical Specifications [optional]
153
+
154
+ ### Model Architecture and Objective
155
+
156
+ [More Information Needed]
157
+
158
+ ### Compute Infrastructure
159
+
160
+ [More Information Needed]
161
+
162
+ #### Hardware
163
+
164
+ [More Information Needed]
165
+
166
+ #### Software
167
+
168
+ [More Information Needed]
169
+
170
+ ## Citation [optional]
171
+
172
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
173
+
174
+ **BibTeX:**
175
+
176
+ [More Information Needed]
177
+
178
+ **APA:**
179
+
180
+ [More Information Needed]
181
+
182
+ ## Glossary [optional]
183
+
184
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
185
+
186
+ [More Information Needed]
187
+
188
+ ## More Information [optional]
189
+
190
+ [More Information Needed]
191
+
192
+ ## Model Card Authors [optional]
193
+
194
+ [More Information Needed]
195
+
196
+ ## Model Card Contact
197
+
198
+ [More Information Needed]
199
+
200
+
201
+ ## Training procedure
202
+
203
+
204
+ The following `bitsandbytes` quantization config was used during training:
205
+ - quant_method: QuantizationMethod.BITS_AND_BYTES
206
+ - load_in_8bit: False
207
+ - load_in_4bit: True
208
+ - llm_int8_threshold: 6.0
209
+ - llm_int8_skip_modules: None
210
+ - llm_int8_enable_fp32_cpu_offload: False
211
+ - llm_int8_has_fp16_weight: False
212
+ - bnb_4bit_quant_type: nf4
213
+ - bnb_4bit_use_double_quant: True
214
+ - bnb_4bit_compute_dtype: float16
215
+
216
+ ### Framework versions
217
+
218
+
219
+ - PEFT 0.6.2
LLM-Detector-V5-11w/checkpoint-21000/adapter_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "./Qwen-14B-Chat",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layers_pattern": null,
10
+ "layers_to_transform": null,
11
+ "lora_alpha": 16.0,
12
+ "lora_dropout": 0.1,
13
+ "modules_to_save": null,
14
+ "peft_type": "LORA",
15
+ "r": 8,
16
+ "rank_pattern": {},
17
+ "revision": null,
18
+ "target_modules": [
19
+ "c_attn"
20
+ ],
21
+ "task_type": "CAUSAL_LM"
22
+ }
LLM-Detector-V5-11w/checkpoint-21000/adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9676e557f268125346b3cafb8bc11f0b945e39e8f5840ece332ce5ffbdaf7db5
3
+ size 26243102
LLM-Detector-V5-11w/checkpoint-21000/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18d139866f1a7697e27b3d0a75fec4ce13c19f7f91e0d9c12607c2c42fe9287d
3
+ size 52496442
LLM-Detector-V5-11w/checkpoint-21000/qwen.tiktoken ADDED
The diff for this file is too large to render. See raw diff
 
LLM-Detector-V5-11w/checkpoint-21000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c69dd10e027369fa679f0710061cf9a69c9ad685e2576c58aa25eeecc76db570
3
+ size 14244
LLM-Detector-V5-11w/checkpoint-21000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4fa4b00b1cba54897c2cbf8301611ceaa02033f2121ce9abb7ed43742023e50
3
+ size 1064
LLM-Detector-V5-11w/checkpoint-21000/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_end|>"
4
+ ],
5
+ "eos_token": "<|endoftext|>",
6
+ "pad_token": "<|endoftext|>"
7
+ }
LLM-Detector-V5-11w/checkpoint-21000/tokenization_qwen.py ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Alibaba Cloud.
2
+ #
3
+ # This source code is licensed under the license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ """Tokenization classes for QWen."""
7
+
8
+ import base64
9
+ import logging
10
+ import os
11
+ import unicodedata
12
+ from typing import Collection, Dict, List, Set, Tuple, Union
13
+
14
+ import tiktoken
15
+ from transformers import PreTrainedTokenizer, AddedToken
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ VOCAB_FILES_NAMES = {"vocab_file": "qwen.tiktoken"}
21
+
22
+ PAT_STR = r"""(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}| ?[^\s\p{L}\p{N}]+[\r\n]*|\s*[\r\n]+|\s+(?!\S)|\s+"""
23
+ ENDOFTEXT = "<|endoftext|>"
24
+ IMSTART = "<|im_start|>"
25
+ IMEND = "<|im_end|>"
26
+ # as the default behavior is changed to allow special tokens in
27
+ # regular texts, the surface forms of special tokens need to be
28
+ # as different as possible to minimize the impact
29
+ EXTRAS = tuple((f"<|extra_{i}|>" for i in range(205)))
30
+ # changed to use actual index to avoid misconfiguration with vocabulary expansion
31
+ SPECIAL_START_ID = 151643
32
+ SPECIAL_TOKENS = tuple(
33
+ enumerate(
34
+ (
35
+ (
36
+ ENDOFTEXT,
37
+ IMSTART,
38
+ IMEND,
39
+ )
40
+ + EXTRAS
41
+ ),
42
+ start=SPECIAL_START_ID,
43
+ )
44
+ )
45
+ SPECIAL_TOKENS_SET = set(t for i, t in SPECIAL_TOKENS)
46
+
47
+
48
+ def _load_tiktoken_bpe(tiktoken_bpe_file: str) -> Dict[bytes, int]:
49
+ with open(tiktoken_bpe_file, "rb") as f:
50
+ contents = f.read()
51
+ return {
52
+ base64.b64decode(token): int(rank)
53
+ for token, rank in (line.split() for line in contents.splitlines() if line)
54
+ }
55
+
56
+
57
+ class QWenTokenizer(PreTrainedTokenizer):
58
+ """QWen tokenizer."""
59
+
60
+ vocab_files_names = VOCAB_FILES_NAMES
61
+
62
+ def __init__(
63
+ self,
64
+ vocab_file,
65
+ errors="replace",
66
+ extra_vocab_file=None,
67
+ **kwargs,
68
+ ):
69
+ super().__init__(**kwargs)
70
+
71
+ # how to handle errors in decoding UTF-8 byte sequences
72
+ # use ignore if you are in streaming inference
73
+ self.errors = errors
74
+
75
+ self.mergeable_ranks = _load_tiktoken_bpe(vocab_file) # type: Dict[bytes, int]
76
+ self.special_tokens = {
77
+ token: index
78
+ for index, token in SPECIAL_TOKENS
79
+ }
80
+
81
+ # try load extra vocab from file
82
+ if extra_vocab_file is not None:
83
+ used_ids = set(self.mergeable_ranks.values()) | set(self.special_tokens.values())
84
+ extra_mergeable_ranks = _load_tiktoken_bpe(extra_vocab_file)
85
+ for token, index in extra_mergeable_ranks.items():
86
+ if token in self.mergeable_ranks:
87
+ logger.info(f"extra token {token} exists, skipping")
88
+ continue
89
+ if index in used_ids:
90
+ logger.info(f'the index {index} for extra token {token} exists, skipping')
91
+ continue
92
+ self.mergeable_ranks[token] = index
93
+ # the index may be sparse after this, but don't worry tiktoken.Encoding will handle this
94
+
95
+ enc = tiktoken.Encoding(
96
+ "Qwen",
97
+ pat_str=PAT_STR,
98
+ mergeable_ranks=self.mergeable_ranks,
99
+ special_tokens=self.special_tokens,
100
+ )
101
+ assert (
102
+ len(self.mergeable_ranks) + len(self.special_tokens) == enc.n_vocab
103
+ ), f"{len(self.mergeable_ranks) + len(self.special_tokens)} != {enc.n_vocab} in encoding"
104
+
105
+ self.decoder = {
106
+ v: k for k, v in self.mergeable_ranks.items()
107
+ } # type: dict[int, bytes|str]
108
+ self.decoder.update({v: k for k, v in self.special_tokens.items()})
109
+
110
+ self.tokenizer = enc # type: tiktoken.Encoding
111
+
112
+ self.eod_id = self.tokenizer.eot_token
113
+ self.im_start_id = self.special_tokens[IMSTART]
114
+ self.im_end_id = self.special_tokens[IMEND]
115
+
116
+ def __getstate__(self):
117
+ # for pickle lovers
118
+ state = self.__dict__.copy()
119
+ del state["tokenizer"]
120
+ return state
121
+
122
+ def __setstate__(self, state):
123
+ # tokenizer is not python native; don't pass it; rebuild it
124
+ self.__dict__.update(state)
125
+ enc = tiktoken.Encoding(
126
+ "Qwen",
127
+ pat_str=PAT_STR,
128
+ mergeable_ranks=self.mergeable_ranks,
129
+ special_tokens=self.special_tokens,
130
+ )
131
+ self.tokenizer = enc
132
+
133
+ def __len__(self) -> int:
134
+ return self.tokenizer.n_vocab
135
+
136
+ def get_vocab(self) -> Dict[bytes, int]:
137
+ return self.mergeable_ranks
138
+
139
+ def convert_tokens_to_ids(
140
+ self, tokens: Union[bytes, str, List[Union[bytes, str]]]
141
+ ) -> List[int]:
142
+ ids = []
143
+ if isinstance(tokens, (str, bytes)):
144
+ if tokens in self.special_tokens:
145
+ return self.special_tokens[tokens]
146
+ else:
147
+ return self.mergeable_ranks.get(tokens)
148
+ for token in tokens:
149
+ if token in self.special_tokens:
150
+ ids.append(self.special_tokens[token])
151
+ else:
152
+ ids.append(self.mergeable_ranks.get(token))
153
+ return ids
154
+
155
+ def _add_tokens(
156
+ self,
157
+ new_tokens: Union[List[str], List[AddedToken]],
158
+ special_tokens: bool = False,
159
+ ) -> int:
160
+ if not special_tokens and new_tokens:
161
+ raise ValueError("Adding regular tokens is not supported")
162
+ for token in new_tokens:
163
+ surface_form = token.content if isinstance(token, AddedToken) else token
164
+ if surface_form not in SPECIAL_TOKENS_SET:
165
+ raise ValueError("Adding unknown special tokens is not supported")
166
+ return 0
167
+
168
+ def save_vocabulary(self, save_directory: str, **kwargs) -> Tuple[str]:
169
+ """
170
+ Save only the vocabulary of the tokenizer (vocabulary).
171
+
172
+ Returns:
173
+ `Tuple(str)`: Paths to the files saved.
174
+ """
175
+ file_path = os.path.join(save_directory, "qwen.tiktoken")
176
+ with open(file_path, "w", encoding="utf8") as w:
177
+ for k, v in self.mergeable_ranks.items():
178
+ line = base64.b64encode(k).decode("utf8") + " " + str(v) + "\n"
179
+ w.write(line)
180
+ return (file_path,)
181
+
182
+ def tokenize(
183
+ self,
184
+ text: str,
185
+ allowed_special: Union[Set, str] = "all",
186
+ disallowed_special: Union[Collection, str] = (),
187
+ **kwargs,
188
+ ) -> List[Union[bytes, str]]:
189
+ """
190
+ Converts a string in a sequence of tokens.
191
+
192
+ Args:
193
+ text (`str`):
194
+ The sequence to be encoded.
195
+ allowed_special (`Literal["all"]` or `set`):
196
+ The surface forms of the tokens to be encoded as special tokens in regular texts.
197
+ Default to "all".
198
+ disallowed_special (`Literal["all"]` or `Collection`):
199
+ The surface forms of the tokens that should not be in regular texts and trigger errors.
200
+ Default to an empty tuple.
201
+
202
+ kwargs (additional keyword arguments, *optional*):
203
+ Will be passed to the underlying model specific encode method.
204
+
205
+ Returns:
206
+ `List[bytes|str]`: The list of tokens.
207
+ """
208
+ tokens = []
209
+ text = unicodedata.normalize("NFC", text)
210
+
211
+ # this implementation takes a detour: text -> token id -> token surface forms
212
+ for t in self.tokenizer.encode(
213
+ text, allowed_special=allowed_special, disallowed_special=disallowed_special
214
+ ):
215
+ tokens.append(self.decoder[t])
216
+ return tokens
217
+
218
+ def convert_tokens_to_string(self, tokens: List[Union[bytes, str]]) -> str:
219
+ """
220
+ Converts a sequence of tokens in a single string.
221
+ """
222
+ text = ""
223
+ temp = b""
224
+ for t in tokens:
225
+ if isinstance(t, str):
226
+ if temp:
227
+ text += temp.decode("utf-8", errors=self.errors)
228
+ temp = b""
229
+ text += t
230
+ elif isinstance(t, bytes):
231
+ temp += t
232
+ else:
233
+ raise TypeError("token should only be of type types or str")
234
+ if temp:
235
+ text += temp.decode("utf-8", errors=self.errors)
236
+ return text
237
+
238
+ @property
239
+ def vocab_size(self):
240
+ return self.tokenizer.n_vocab
241
+
242
+ def _convert_id_to_token(self, index: int) -> Union[bytes, str]:
243
+ """Converts an id to a token, special tokens included"""
244
+ if index in self.decoder:
245
+ return self.decoder[index]
246
+ raise ValueError("unknown ids")
247
+
248
+ def _convert_token_to_id(self, token: Union[bytes, str]) -> int:
249
+ """Converts a token to an id using the vocab, special tokens included"""
250
+ if token in self.special_tokens:
251
+ return self.special_tokens[token]
252
+ if token in self.mergeable_ranks:
253
+ return self.mergeable_ranks[token]
254
+ raise ValueError("unknown token")
255
+
256
+ def _tokenize(self, text: str, **kwargs):
257
+ """
258
+ Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based
259
+ vocabulary or sub-words for sub-word-based vocabularies (BPE/SentencePieces/WordPieces).
260
+
261
+ Do NOT take care of added tokens.
262
+ """
263
+ raise NotImplementedError
264
+
265
+ def _decode(
266
+ self,
267
+ token_ids: Union[int, List[int]],
268
+ skip_special_tokens: bool = False,
269
+ errors: str = None,
270
+ **kwargs,
271
+ ) -> str:
272
+ if isinstance(token_ids, int):
273
+ token_ids = [token_ids]
274
+ if skip_special_tokens:
275
+ token_ids = [i for i in token_ids if i < self.eod_id]
276
+ return self.tokenizer.decode(token_ids, errors=errors or self.errors)
LLM-Detector-V5-11w/checkpoint-21000/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoTokenizer": [
4
+ "tokenization_qwen.QWenTokenizer",
5
+ null
6
+ ]
7
+ },
8
+ "clean_up_tokenization_spaces": true,
9
+ "model_max_length": 8192,
10
+ "padding_side": "right",
11
+ "split_special_tokens": false,
12
+ "tokenizer_class": "QWenTokenizer"
13
+ }