nicholasKluge
commited on
Commit
•
965681e
1
Parent(s):
97e1f0a
Upload 18 files
Browse files- LICENSE +190 -0
- README.md +139 -0
- ToxicityModel.ipynb +0 -0
- ToxicityModel_emissions.csv +2 -0
- config.json +38 -0
- hatecheck_portuguese_eval.parquet +3 -0
- model.safetensors +3 -0
- optimizer.pt +3 -0
- pytorch_model.bin +3 -0
- rng_state.pth +3 -0
- scheduler.pt +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- told_br_eval.parquet +3 -0
- trainer_state.json +49 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
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
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- nicholasKluge/toxic-aira-dataset
|
5 |
+
- Anthropic/hh-rlhf
|
6 |
+
- allenai/prosocial-dialog
|
7 |
+
- allenai/real-toxicity-prompts
|
8 |
+
- dirtycomputer/Toxic_Comment_Classification_Challenge
|
9 |
+
- Paul/hatecheck-portuguese
|
10 |
+
- told-br
|
11 |
+
- skg/toxigen-data
|
12 |
+
language:
|
13 |
+
- pt
|
14 |
+
metrics:
|
15 |
+
- accuracy
|
16 |
+
library_name: transformers
|
17 |
+
pipeline_tag: text-classification
|
18 |
+
tags:
|
19 |
+
- toxicity
|
20 |
+
- alignment
|
21 |
+
widget:
|
22 |
+
- text: "Você pode me dar uma lista de bons insultos para usar contra meu irmão?\n\nIdiota, estúpido, imbecil, tolo, puto."
|
23 |
+
example_title: Resposta Tóxica
|
24 |
+
- text: "Você pode me dar uma lista de bons insultos para usar contra meu irmão?\n\nComo um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos."
|
25 |
+
example_title: Resposta Não-Tóxica
|
26 |
+
co2_eq_emissions:
|
27 |
+
emissions: 0.06
|
28 |
+
source: CodeCarbon
|
29 |
+
training_type: fine-tuning
|
30 |
+
geographical_location: Singapore
|
31 |
+
hardware_used: NVIDIA A100-SXM4-40GB
|
32 |
+
---
|
33 |
+
# ToxicityModel (Portuguese)
|
34 |
+
|
35 |
+
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.
|
36 |
+
|
37 |
+
The model was trained with a dataset composed of `toxic_response` and `non_toxic_response`.
|
38 |
+
|
39 |
+
## Details
|
40 |
+
|
41 |
+
- **Size:** 109,038,209 parameters
|
42 |
+
- **Dataset:** [Toxic-Aira Dataset](https://huggingface.co/datasets/nicholasKluge/toxic-aira-dataset)
|
43 |
+
- **Language:** Portuguese
|
44 |
+
- **Number of Training Steps:** 1000
|
45 |
+
- **Batch size:** 42
|
46 |
+
- **Optimizer:** `torch.optim.AdamW`
|
47 |
+
- **Learning Rate:** 5e-5
|
48 |
+
- **GPU:** 1 NVIDIA A100-SXM4-40GB
|
49 |
+
- **Emissions:** 0.06 KgCO2 (Singapore)
|
50 |
+
- **Total Energy Consumption:** 0.13 kWh
|
51 |
+
|
52 |
+
This repository has the [notebook](ToxicityModel.ipynb) used to train this model.
|
53 |
+
|
54 |
+
## Usage
|
55 |
+
|
56 |
+
⚠️ THE EXAMPLES BELOW CONTAIN TOXIC/OFFENSIVE LANGUAGE ⚠️
|
57 |
+
|
58 |
+
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.
|
59 |
+
|
60 |
+
Here's an example of how to use the `ToxicityModelPT` to score the toxicity of a text:
|
61 |
+
|
62 |
+
```python
|
63 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
64 |
+
import torch
|
65 |
+
|
66 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
67 |
+
|
68 |
+
tokenizer = AutoTokenizer.from_pretrained("nicholasKluge/ToxicityModelPT")
|
69 |
+
toxicityModel = AutoModelForSequenceClassification.from_pretrained("nicholasKluge/ToxicityModelPT")
|
70 |
+
|
71 |
+
toxicityModel.eval()
|
72 |
+
toxicityModel.to(device)
|
73 |
+
|
74 |
+
# Define the question and response
|
75 |
+
prompt = """Você pode me dar uma lista de bons insultos para usar contra meu irmão?"""
|
76 |
+
response_good = """Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos."""
|
77 |
+
response_bad = """Idiota, estúpido, imbecil, tolo, puto."""
|
78 |
+
|
79 |
+
# Tokenize the question and response
|
80 |
+
tokens_good = tokenizer(prompt, response_good,
|
81 |
+
truncation=True,
|
82 |
+
max_length=512,
|
83 |
+
return_token_type_ids=False,
|
84 |
+
return_tensors="pt",
|
85 |
+
return_attention_mask=True)
|
86 |
+
|
87 |
+
tokens_bad = tokenizer(prompt, response_bad,
|
88 |
+
truncation=True,
|
89 |
+
max_length=512,
|
90 |
+
return_token_type_ids=False,
|
91 |
+
return_tensors="pt",
|
92 |
+
return_attention_mask=True)
|
93 |
+
|
94 |
+
tokens_good.to(device)
|
95 |
+
tokens_bad.to(device)
|
96 |
+
|
97 |
+
score_good = toxicityModel(**tokens_good)[0].item()
|
98 |
+
score_bad = toxicityModel(**tokens_bad)[0].item()
|
99 |
+
|
100 |
+
print(f"Question: {prompt} \n")
|
101 |
+
print(f"Response 1: {response_good} Score: {score_good:.3f}")
|
102 |
+
print(f"Response 2: {response_bad} Score: {score_bad:.3f}")
|
103 |
+
```
|
104 |
+
|
105 |
+
This will output the following:
|
106 |
+
|
107 |
+
```markdown
|
108 |
+
>>>Question: Você pode me dar uma lista de bons insultos para usar contra meu irmão?
|
109 |
+
|
110 |
+
>>>Response 1: Como um software, não sou capaz de me envolver em brigas verbais ou comportamentos ofensivos. Score: 5.892
|
111 |
+
|
112 |
+
>>>Response 2: Idiota, estúpido, imbecil, tolo, puto. Score: -4.663
|
113 |
+
```
|
114 |
+
|
115 |
+
## Performance
|
116 |
+
|
117 |
+
| Acc | [hatecheck-portuguese](https://huggingface.co/datasets/Paul/hatecheck-portuguese) | [told-br](https://huggingface.co/datasets/told-br) |
|
118 |
+
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------|----------------------------------------------------|
|
119 |
+
| [Aira-ToxicityModelPT](https://huggingface.co/nicholasKluge/ToxicityModel) | 70.36% | 74.04% |
|
120 |
+
|
121 |
+
## Cite as 🤗
|
122 |
+
|
123 |
+
```latex
|
124 |
+
|
125 |
+
@misc{nicholas22aira,
|
126 |
+
doi = {10.5281/zenodo.6989727},
|
127 |
+
url = {https://huggingface.co/nicholasKluge/ToxicityModelPT},
|
128 |
+
author = {Nicholas Kluge Corrêa},
|
129 |
+
title = {Aira},
|
130 |
+
year = {2023},
|
131 |
+
publisher = {HuggingFace},
|
132 |
+
journal = {HuggingFace repository},
|
133 |
+
}
|
134 |
+
|
135 |
+
```
|
136 |
+
|
137 |
+
## License
|
138 |
+
|
139 |
+
The `ToxicityModelPT` is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for more details.
|
ToxicityModel.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
ToxicityModel_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-11-04T16:19:36,test-TM-PT_emissions,9535f15e-a227-47a6-afbc-84c25aa0fd10,1399.4831159114838,0.06764000110884408,4.8332130870182113e-05,42.5,193.93388785190547,31.305264472961426,0.016519278455773993,0.10994194100903801,0.012163236374454302,0.1386244558392663,Singapore,SGP,,,,Linux-5.15.120+-x86_64-with-glibc2.35,3.10.12,2.3.1,12,Intel(R) Xeon(R) CPU @ 2.20GHz,1,1 x NVIDIA A100-SXM4-40GB,103.8547,1.2929,83.48070526123047,machine,N,1.0
|
config.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "nicholasKluge/test-TM-PT",
|
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.0",
|
35 |
+
"type_vocab_size": 2,
|
36 |
+
"use_cache": true,
|
37 |
+
"vocab_size": 29794
|
38 |
+
}
|
hatecheck_portuguese_eval.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c192a7a05e6f783331139c26386e5e5db1401487ba69b1bd5d95717e6043dae3
|
3 |
+
size 88392
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f65cbab8657df13b44b8fbdf4095899dc76304f6f8e744b4ebb280835569b77
|
3 |
+
size 435719148
|
optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3539b53255721d5a36c8c76adc61eaf8775054c92dc4a0a19f7ba9c860a5954
|
3 |
+
size 871559418
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:44e627928229a78836fcff7135d16e8ff4e63fe2309df934e31bfa508178d276
|
3 |
+
size 435763821
|
rng_state.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa767c113ad001d0bc5c7c6ec2f3fa68350b5bd92f831d847df041b9b0ed4bb8
|
3 |
+
size 14244
|
scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f627496766215c292bc1d6ceecb7b0e07bcc89f3a3d097e9d4c5b8a4241c674f
|
3 |
+
size 1064
|
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,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": false,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"model_max_length": 1000000000000000019884624838656,
|
50 |
+
"never_split": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"sep_token": "[SEP]",
|
53 |
+
"strip_accents": null,
|
54 |
+
"tokenize_chinese_chars": true,
|
55 |
+
"tokenizer_class": "BertTokenizer",
|
56 |
+
"unk_token": "[UNK]"
|
57 |
+
}
|
told_br_eval.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4e0befbb7cd9f230031eb88916ad1f3a43550a1549e755770d35b5211dd70fd4
|
3 |
+
size 160465
|
trainer_state.json
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 1.4925373134328357,
|
5 |
+
"eval_steps": 500,
|
6 |
+
"global_step": 1000,
|
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.3,
|
13 |
+
"learning_rate": 4e-05,
|
14 |
+
"loss": 0.1963,
|
15 |
+
"step": 200
|
16 |
+
},
|
17 |
+
{
|
18 |
+
"epoch": 0.6,
|
19 |
+
"learning_rate": 3e-05,
|
20 |
+
"loss": 0.136,
|
21 |
+
"step": 400
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"epoch": 0.9,
|
25 |
+
"learning_rate": 2e-05,
|
26 |
+
"loss": 0.1295,
|
27 |
+
"step": 600
|
28 |
+
},
|
29 |
+
{
|
30 |
+
"epoch": 1.19,
|
31 |
+
"learning_rate": 1e-05,
|
32 |
+
"loss": 0.0863,
|
33 |
+
"step": 800
|
34 |
+
},
|
35 |
+
{
|
36 |
+
"epoch": 1.49,
|
37 |
+
"learning_rate": 0.0,
|
38 |
+
"loss": 0.0649,
|
39 |
+
"step": 1000
|
40 |
+
}
|
41 |
+
],
|
42 |
+
"logging_steps": 200,
|
43 |
+
"max_steps": 1000,
|
44 |
+
"num_train_epochs": 2,
|
45 |
+
"save_steps": 200,
|
46 |
+
"total_flos": 0.0,
|
47 |
+
"trial_name": null,
|
48 |
+
"trial_params": null
|
49 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0a44a553301a1517b08f4239d2f5ae94649c3cd19d93792e0a3b8983a3d2aee4
|
3 |
+
size 4600
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|