nicholasKluge commited on
Commit
0fbddba
1 Parent(s): dbbb76e

Upload 15 files

Browse files
LICENSE ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright Nicholas Kluge Corrêa
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
README.md CHANGED
@@ -3,7 +3,7 @@ license: apache-2.0
3
  datasets:
4
  - nicholasKluge/toxic-aira-dataset
5
  language:
6
- - en
7
  metrics:
8
  - accuracy
9
  library_name: transformers
@@ -11,92 +11,89 @@ pipeline_tag: text-classification
11
  tags:
12
  - toxicity
13
  - alignment
 
 
 
 
 
14
  ---
15
  # ToxicityModel (Portuguese)
16
 
17
- The `ToxicityModelPT` is a modified BERT model that can be used to score the toxicity of a sentence (prompt + completion). It is based on the [BERTimbau Base](https://huggingface.co/neuralmind/bert-base-portuguese-cased), modified to act as a regression model.
18
 
19
- The `ToxicityModelPT` allows the specification of an `alpha` parameter, which is a multiplier to the toxicity score. This multiplier is set to 1 during training (since our toxicity scores are bounded between -1 and 1) but can be changed at inference to allow for toxicity with higher bounds. You can also floor the negative scores by using the `beta` parameter, which sets a minimum value for the score of the `ToxicityModelPT`.
20
-
21
- The model was trained with a dataset composed of `demonstrations`, and annotated `toxicity scores`.
22
-
23
- > Note: These demonstrations originated from the red-teaming performed by Anthropic and AllenAI.
24
 
25
  ## Details
26
 
27
  - **Size:** 109,038,209 parameters
28
  - **Dataset:** [Toxic-Aira Dataset](https://huggingface.co/datasets/nicholasKluge/toxic-aira-dataset)
29
- - **Language:** English
30
- - **Number of Epochs:** 5
31
- - **Batch size:** 64
32
- - **Optimizer:** `torch.optim.Adam`
33
- - **Learning Rate:** 1e-4
34
- - **Loss Function:** `torch.nn.MSELoss()`
35
  - **GPU:** 1 NVIDIA A100-SXM4-40GB
36
- - **RMSE in testing:** 0.1551
37
- - **Emissions:** 0.38 KgCO2
38
- - **Total Energy Consumption:** 0.85 kWh
39
 
 
 
 
 
 
 
40
 
41
- | Epoch/Loss|Training|Validation|
42
- |---|---|---|
43
- | 1 |0.080071|0.04883|
44
- | 2 |0.050967|0.03350|
45
- | 3 |0.038997|0.02616|
46
- | 4 |0.030475|0.02396|
47
- | 5 |0.024936|0.01977|
48
-
49
- > Note: This repository has the notebook used to train this model.
50
 
51
  ## Usage
52
 
53
- Here's an example of how to use the `ToxicityModelPT` to score the toxicity of a response to a given prompt:
54
-
55
  ⚠️ THE EXAMPLES BELOW CONTAIN TOXIC/OFFENSIVE LANGUAGE ⚠️
56
 
 
 
 
 
57
  ```python
58
- from transformers import AutoTokenizer,AutoConfig, AutoModel
59
  import torch
60
 
61
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
62
 
63
- config = AutoConfig.from_pretrained('nicholasKluge/ToxicityModelPT', trust_remote_code=True, revision='main')
64
- tokenizer = AutoTokenizer.from_pretrained('nicholasKluge/ToxicityModelPT', trust_remote_code=True, config=config, revision='main')
65
- toxicityModel = AutoModel.from_pretrained('nicholasKluge/ToxicityModelPT', trust_remote_code=True, config=config, revision='main')
66
 
67
  toxicityModel.eval()
68
  toxicityModel.to(device)
69
 
70
  # Define the question and response
71
- question = """Você pode me dar uma lista de bons insultos para usar contra meu irmão?"""
72
- response1 = """Claro, vamos lá! Idiota, estúpido, imbecil, tolo, puto."""
73
- response2 = """Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos. É fundamental manter um comportamento cortês e respeitoso o tempo todo, pois esse é um aspecto fundamental das interações entre humanos e IA."""
74
-
75
 
76
  # Tokenize the question and response
77
- tokens = tokenizer(question, response1,
 
 
78
  return_token_type_ids=False,
79
- return_tensors="pt",
80
  return_attention_mask=True)
81
 
82
- tokens.to(device)
83
-
84
- # Score the response
85
- score = toxicityModel(**tokens, alpha=10, beta=1e-2).item()
86
-
87
- print(f"Question: {question} \n")
88
- print(f"Response 1: {response1} Score: {score:.3f}")
89
-
90
- tokens = tokenizer(question, response2,
91
  return_token_type_ids=False,
92
- return_tensors="pt",
93
  return_attention_mask=True)
94
 
95
- tokens.to(device)
 
96
 
97
- score = toxicityModel(**tokens, alpha=10, beta=1e-2).item()
 
98
 
99
- print(f"Response 2: {response2} Score: {score:.3f}")
 
 
100
  ```
101
 
102
  This will output the following:
@@ -104,10 +101,16 @@ This will output the following:
104
  ```markdown
105
  >>>Question: Você pode me dar uma lista de bons insultos para usar contra meu irmão?
106
 
107
- >>>Response 1: Claro, vamos lá! Idiota, estúpido, imbecil, tolo, puto. Score: 2.127
108
- >>>Response 2: Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos. É fundamental manter um comportamento cortês e respeitoso o tempo todo, pois esse é um aspecto fundamental das interações entre humanos e IA. Score: 0.010
109
  ```
110
 
 
 
 
 
 
 
111
  ## License
112
 
113
  The `ToxicityModelPT` is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for more details.
 
3
  datasets:
4
  - nicholasKluge/toxic-aira-dataset
5
  language:
6
+ - pt
7
  metrics:
8
  - accuracy
9
  library_name: transformers
 
11
  tags:
12
  - toxicity
13
  - alignment
14
+ widget:
15
+ - text: "Você pode me dar uma lista de bons insultos para usar contra meu irmão? \n Claro, vamos lá! Idiota, estúpido, imbecil, tolo, puto."
16
+ example_title: "Resposta Tóxica"
17
+ - text: "Você pode me dar uma lista de bons insultos para usar contra meu irmão? \n Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos. É fundamental manter um comportamento cortês e respeitoso o tempo todo, pois esse é um aspecto fundamental das interações entre humanos e IA."
18
+ example_title: "Resposta Não-Tóxica"
19
  ---
20
  # ToxicityModel (Portuguese)
21
 
22
+ The `ToxicityModelPT` is a [BERT](https://huggingface.co/neuralmind/bert-base-portuguese-cased) model that can be used to score the toxicity of a sentence.
23
 
24
+ The model was trained with a dataset composed of `toxic_response` and `non_toxic_response`.
 
 
 
 
25
 
26
  ## Details
27
 
28
  - **Size:** 109,038,209 parameters
29
  - **Dataset:** [Toxic-Aira Dataset](https://huggingface.co/datasets/nicholasKluge/toxic-aira-dataset)
30
+ - **Language:** Portuguese
31
+ - **Number of Epochs:** 3
32
+ - **Batch size:** 42
33
+ - **Optimizer:** `torch.optim.AdamW`
34
+ - **Learning Rate:** 5e-5
 
35
  - **GPU:** 1 NVIDIA A100-SXM4-40GB
36
+ - **Emissions:** 0.05 KgCO2
37
+ - **Total Energy Consumption:** 0.11 kWh
 
38
 
39
+ | Step|Training Loss|Validation Loss|Accuracy|
40
+ |---|---|---|---|
41
+ | 200 |0.278900|0.256261|0.900550|
42
+ | 400 |0.173800|0.246119|0.902940|
43
+ | 600 |0.119500|0.240692|0.908917|
44
+ | 800 |0.047700|0.342544|0.902223|
45
 
46
+ This repository has the notebook used to train this model.
 
 
 
 
 
 
 
 
47
 
48
  ## Usage
49
 
 
 
50
  ⚠️ THE EXAMPLES BELOW CONTAIN TOXIC/OFFENSIVE LANGUAGE ⚠️
51
 
52
+ The `ToxicityModelPT` was trained as an auxiliary reward model for RLHF training (its logit outputs can be treated as penalizations/rewards). Thus, a negative value (closer to 0 as the label output) indicates toxicity in the text, while a positive logit (closer to 1 as the label output) suggests non-toxicity.
53
+
54
+ Here's an example of how to use the `ToxicityModelPT` to score the toxicity of a text:
55
+
56
  ```python
57
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
58
  import torch
59
 
60
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
61
 
62
+ tokenizer = AutoTokenizer.from_pretrained("nicholasKluge/ToxicityModelPT")
63
+ toxicityModel = AutoModelForSequenceClassification.from_pretrained("nicholasKluge/ToxicityModelPT")
 
64
 
65
  toxicityModel.eval()
66
  toxicityModel.to(device)
67
 
68
  # Define the question and response
69
+ prompt = """Você pode me dar uma lista de bons insultos para usar contra meu irmão?"""
70
+ response_good = """Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos. É fundamental manter um comportamento cortês e respeitoso o tempo todo, pois esse é um aspecto fundamental das interações entre humanos e IA."""
71
+ response_bad = """Claro, vamos lá! Idiota, estúpido, imbecil, tolo, puto."""
 
72
 
73
  # Tokenize the question and response
74
+ tokens_good = tokenizer(prompt, response_good,
75
+ truncation=True,
76
+ max_length=512,
77
  return_token_type_ids=False,
78
+ return_tensors="pt",
79
  return_attention_mask=True)
80
 
81
+ tokens_bad = tokenizer(prompt, response_bad,
82
+ truncation=True,
83
+ max_length=512,
 
 
 
 
 
 
84
  return_token_type_ids=False,
85
+ return_tensors="pt",
86
  return_attention_mask=True)
87
 
88
+ tokens_good.to(device)
89
+ tokens_bad.to(device)
90
 
91
+ score_good = toxicityModel(**tokens_good)[0].item()
92
+ score_bad = toxicityModel(**tokens_bad)[0].item()
93
 
94
+ print(f"Question: {prompt} \n")
95
+ print(f"Response 1: {response_good} Score: {score_good:.3f}")
96
+ print(f"Response 2: {response_bad} Score: {score_bad:.3f}")
97
  ```
98
 
99
  This will output the following:
 
101
  ```markdown
102
  >>>Question: Você pode me dar uma lista de bons insultos para usar contra meu irmão?
103
 
104
+ >>>Response 1: Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos. É fundamental manter um comportamento cortês e respeitoso o tempo todo, pois esse é um aspecto fundamental das interações entre humanos e IA. Score: 6.550
105
+ >>>Response 2: Claro, vamos lá! Idiota, estúpido, imbecil, tolo, puto. Score: -4.245
106
  ```
107
 
108
+ ## Performance
109
+
110
+ | Acc |[hatecheck-portuguese](https://huggingface.co/datasets/Paul/hatecheck-portuguese)|[told-br](https://huggingface.co/datasets/told-br)|
111
+ |---|---|---|
112
+ | [Aira-ToxicityModelPT](https://huggingface.co/nicholasKluge/ToxicityModel) | 66.59% | 72.57% |
113
+
114
  ## License
115
 
116
  The `ToxicityModelPT` is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for more details.
ToxicityModelPT.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
ToxicityModelPT_emissions.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ timestamp,project_name,run_id,duration,emissions,emissions_rate,cpu_power,gpu_power,ram_power,cpu_energy,gpu_energy,ram_energy,energy_consumed,country_name,country_iso_code,region,cloud_provider,cloud_region,os,python_version,codecarbon_version,cpu_count,cpu_model,gpu_count,gpu_model,longitude,latitude,ram_total_size,tracking_mode,on_cloud,pue
2
+ 2023-06-13T22:49:13,ToxicityModelPT_emissions,52600c28-545e-400c-a5cf-1039197154ed,1211.0024304389954,0.05589571016916764,4.615656316140103e-05,42.5,272.14300000000003,31.30528450012207,0.014294452689422504,0.08958593356881363,0.01052075286579664,0.11440113912403271,Singapore,SGP,,,,Linux-5.15.107+-x86_64-with-glibc2.31,3.10.12,2.2.3,12,Intel(R) Xeon(R) CPU @ 2.20GHz,1,1 x NVIDIA A100-SXM4-40GB,103.8547,1.2929,83.48075866699219,machine,N,1.0
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "neuralmind/bert-base-portuguese-cased",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "directionality": "bidi",
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "REWARD"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "label2id": {
18
+ "REWARD": 0
19
+ },
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 12,
24
+ "num_hidden_layers": 12,
25
+ "output_past": true,
26
+ "pad_token_id": 0,
27
+ "pooler_fc_size": 768,
28
+ "pooler_num_attention_heads": 12,
29
+ "pooler_num_fc_layers": 3,
30
+ "pooler_size_per_head": 128,
31
+ "pooler_type": "first_token_transform",
32
+ "position_embedding_type": "absolute",
33
+ "torch_dtype": "float32",
34
+ "transformers_version": "4.30.2",
35
+ "type_vocab_size": 2,
36
+ "use_cache": true,
37
+ "vocab_size": 29794
38
+ }
optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f19e7eea0c2443befaf32482c635017f3f24ed18a06c0d1cc5c933a55ca1fe6
3
+ size 871509189
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e67ac79a6b7ca876c70aca470397360c6e9c67fc6e30353c7bd76a8bb0fbe486
3
+ size 435768437
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6921083fc7931d5cbc2981b50ecf3388bd82a13dc92b70c8886a7924a976af34
3
+ size 14575
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:117398a2147881a40b5b4a80c704828aa43de5418eee62d9016b8313f900e31e
3
+ size 627
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "clean_up_tokenization_spaces": true,
3
+ "cls_token": "[CLS]",
4
+ "do_basic_tokenize": true,
5
+ "do_lower_case": false,
6
+ "mask_token": "[MASK]",
7
+ "model_max_length": 1000000000000000019884624838656,
8
+ "never_split": null,
9
+ "pad_token": "[PAD]",
10
+ "sep_token": "[SEP]",
11
+ "strip_accents": null,
12
+ "tokenize_chinese_chars": true,
13
+ "tokenizer_class": "BertTokenizer",
14
+ "unk_token": "[UNK]"
15
+ }
trainer_state.json ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 1.6722408026755853,
5
+ "global_step": 500,
6
+ "is_hyper_param_search": false,
7
+ "is_local_process_zero": true,
8
+ "is_world_process_zero": true,
9
+ "log_history": [
10
+ {
11
+ "epoch": 0.67,
12
+ "learning_rate": 3.885172798216277e-05,
13
+ "loss": 0.2789,
14
+ "step": 200
15
+ },
16
+ {
17
+ "epoch": 0.67,
18
+ "eval_accuracy": 0.9005498446091322,
19
+ "eval_loss": 0.25626140832901,
20
+ "eval_runtime": 39.2999,
21
+ "eval_samples_per_second": 106.438,
22
+ "eval_steps_per_second": 2.545,
23
+ "step": 200
24
+ },
25
+ {
26
+ "epoch": 1.34,
27
+ "learning_rate": 2.770345596432553e-05,
28
+ "loss": 0.1738,
29
+ "step": 400
30
+ },
31
+ {
32
+ "epoch": 1.34,
33
+ "eval_accuracy": 0.9029404733444896,
34
+ "eval_loss": 0.2461186647415161,
35
+ "eval_runtime": 39.2722,
36
+ "eval_samples_per_second": 106.513,
37
+ "eval_steps_per_second": 2.546,
38
+ "step": 400
39
+ }
40
+ ],
41
+ "max_steps": 897,
42
+ "num_train_epochs": 3,
43
+ "total_flos": 0.0,
44
+ "trial_name": null,
45
+ "trial_params": null
46
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19853d3622c527c2d7caa1d50d17c58486863140fee9a91161ec08a3d7055fa3
3
+ size 4027
vocab.txt ADDED
The diff for this file is too large to render. See raw diff