Views
No views yet
google/flan-t5-large fine-tuned for toxic → polite rewriting.| Parameter | Value |
|---|---|
| epochs | 3 |
| effective batch | 32 (16 × grad_acc=2, fp16) |
| lr / schedule | 3 e-5, cosine, 3 % warm-up |
| total steps | 1 800 |
| optimizer | AdamW, weight_decay=0.01 |
| hardware | 1 × A100-40 GB |
| metric | score |
|---|---|
| BLEU | 0.82 |
| Avg toxicity (Detoxify) | 0.12 (src 0.71 → tgt 0.12) |
| Success rate (tox≤0.5 AND -20 %) | 89 % |
1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2tok = AutoTokenizer.from_pretrained("RinaldiDev/flan-paradetox-full")
3model = AutoModelForSeq2SeqLM.from_pretrained("RinaldiDev/flan-paradetox-full")
4
5def rewrite_polite(text):
6 inp = f"Rewrite politely:\\nInput: {text}\\nPolite:"
7 ids = tok(inp, return_tensors="pt").input_ids
8 out = model.generate(ids, num_beams=4, max_length=96)
9 return tok.decode(out[0], skip_special_tokens=True)
10
11print(rewrite_polite("Shut up, idiot!"))
12# → "Stop talking"
13
14<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
15
16### Direct Use
17
18<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
19
20
21AI moderation helper
22Toxic-to-polite assistants
23Not for hallucination-free tasks; may still miss subtle hate speech.
24
25### Downstream Use [optional]
26
27<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
28
29[More Information Needed]
30
31### Out-of-Scope Use
32
33<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
34
35[More Information Needed]
36
37## Bias, Risks, and Limitations
38
39<!-- This section is meant to convey both technical and sociotechnical limitations. -->
40
41
42Trained largely on English; fails on code-switching.
43Llama-generated pairs could contain artifacts.
44
45### Recommendations
46
47<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
48
49Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
50
51## How to Get Started with the Model
52
53Use the code below to get started with the model.
54
55[More Information Needed]
56
57## Training Details
58
59### Training Data
60
61<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
62
63[More Information Needed]
64
65### Training Procedure
66
67<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
68
69#### Preprocessing [optional]
70
71[More Information Needed]
72
73
74#### Training Hyperparameters
75
76- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
77
78#### Speeds, Sizes, Times [optional]
79
80<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
81
82[More Information Needed]
83
84## Evaluation
85
86<!-- This section describes the evaluation protocols and provides the results. -->
87
88### Testing Data, Factors & Metrics
89
90#### Testing Data
91
92<!-- This should link to a Dataset Card if possible. -->
93
94[More Information Needed]
95
96#### Factors
97
98<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
99
100[More Information Needed]
101
102#### Metrics
103
104<!-- These are the evaluation metrics being used, ideally with a description of why. -->
105
106[More Information Needed]
107
108### Results
109
110[More Information Needed]
111
112#### Summary
113
114
115
116## Model Examination [optional]
117
118<!-- Relevant interpretability work for the model goes here -->
119
120[More Information Needed]
121
122## Environmental Impact
123
124<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
125
126Carbon 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).
127
128- **Hardware Type:** [More Information Needed]
129- **Hours used:** [More Information Needed]
130- **Cloud Provider:** [More Information Needed]
131- **Compute Region:** [More Information Needed]
132- **Carbon Emitted:** [More Information Needed]
133
134## Technical Specifications [optional]
135
136### Model Architecture and Objective
137
138[More Information Needed]
139
140### Compute Infrastructure
141
142[More Information Needed]
143
144#### Hardware
145
146[More Information Needed]
147
148#### Software
149
150[More Information Needed]
151
152## Citation [optional]
153
154<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
155
156**BibTeX:**
157
158[More Information Needed]
159
160**APA:**
161
162[More Information Needed]
163
164## Glossary [optional]
165
166<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
167
168[More Information Needed]
169
170## More Information [optional]
171
172[More Information Needed]
173
174## Model Card Authors [optional]
175
176[More Information Needed]
177
178## Model Card Contact
179
180[More Information Needed]