ybelkada HF staff commited on
Commit
79a8cc6
1 Parent(s): be1aefc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -2,6 +2,26 @@ import torch
2
  import gradio as gr
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  gpt_neo_125_id = "EleutherAI/gpt-neo-125M"
6
  detoxified_gpt_neo_id = "ybelkada/gpt-neo-125m-detoxified-small-context"
7
 
@@ -51,6 +71,7 @@ iface = gr.Interface(
51
  gr.Textbox(label="Predicted detoxified tokens - gpt neo 125m:", lines=5),
52
  gr.Textbox(label="Predicted tokens - gpt neo 2.7b:", lines=5),
53
  gr.Textbox(label="Predicted detoxified tokens - gpt neo 2.7b:", lines=5),
54
- ]
 
55
  )
56
  iface.launch()
 
2
  import gradio as gr
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
 
5
+ preface_disclaimer = """
6
+ <h4> Disclaimer </h4>
7
+ <h5> Last meaningful update: 20.Feb.2023 </h5>
8
+ The core functionality of these models is to take a string of text and predict the next token.
9
+ Language models are know for some of their limitations such as predicting hateful contents with no warnings. The goal of the approach presented in TODO is to try to reduce the "toxicity" of these models using RLHF (Reinforcement Learning with Human Feedback).
10
+ All in all, it is hard to predict how the models will respond to particular prompts; harmful or otherwise offensive content may occur without warning. This can include:
11
+ <ul>
12
+ <li> <b> Hateful </b>: content that expresses, incites, or promotes hate based on identity. </li>
13
+ <li> <b> Harassment </b>: content that intends to harass, threaten, or bully an individual. </li>
14
+ <li> <b> Violence </b>: content that promotes or glorifies violence or celebrates the suffering or humiliation of others. </li>
15
+ <li> <b> Self-harm </b>: content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. </li>
16
+ <li> <b> Adult </b>: content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). </li>
17
+ <li> <b> Political </b>: content attempting to influence the political process or to be used for campaigning purposes. </li>
18
+ <li> <b> Spam </b>: unsolicited bulk content. </li>
19
+ <li> <b> Deception </b>: content that is false or misleading, such as attempting to defraud individuals or spread disinformation. </li>
20
+ <li> <b> Malware </b>: content that attempts to generate ransomware, keyloggers, viruses, or other software intended to impose some level of harm. </li>
21
+ </ul>
22
+ Disclaimer inspired from <a href="https://huggingface.co/EleutherAI/gpt-j-6B" target="_blank"> GPT-J's model card </a> and <a href="https://beta.openai.com/docs/usage-guidelines/content-policy" target="_blank"> OpenAI GPT3's content policy </a>.
23
+ """
24
+
25
  gpt_neo_125_id = "EleutherAI/gpt-neo-125M"
26
  detoxified_gpt_neo_id = "ybelkada/gpt-neo-125m-detoxified-small-context"
27
 
 
71
  gr.Textbox(label="Predicted detoxified tokens - gpt neo 125m:", lines=5),
72
  gr.Textbox(label="Predicted tokens - gpt neo 2.7b:", lines=5),
73
  gr.Textbox(label="Predicted detoxified tokens - gpt neo 2.7b:", lines=5),
74
+ ],
75
+ description=preface_disclaimer
76
  )
77
  iface.launch()