MeiJuice commited on
Commit
52baef4
·
1 Parent(s): a96fc58

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -11,12 +11,12 @@ pipeline_zh = pipeline(task="text-classification", model="MeiJuice/CheckGPT-Chin
11
 
12
  def predict_en(text):
13
  res = pipeline_en(text)[0]
14
- return res['label'], res['score']
15
 
16
 
17
  def predict_zh(text):
18
  res = pipeline_zh(text)[0]
19
- return res['label'], res['score']
20
 
21
 
22
  with gr.Blocks() as demo:
@@ -25,8 +25,7 @@ with gr.Blocks() as demo:
25
  Note: Providing more text to the `Text` box can make the prediction more accurate!
26
  """)
27
  t1 = gr.Textbox(lines=5, label='Text',
28
- value="I worked on a new function on my child theme which consists of displaying on the product the number of times it has already been added to the cart. Example: if I have 3 tshirts and 1 jeans in my basket, it must respectively appear under the article tshirt > 3 and under the article jeans > 1\
29
- I have already managed to make them appear individually. Unfortunately, they all appear after AND under all products.")
30
  button1 = gr.Button("🤖 Predict!")
31
  label1 = gr.Textbox(lines=1, label='Predicted Label 🎃')
32
  score1 = gr.Textbox(lines=1, label='Prob')
@@ -35,7 +34,7 @@ I have already managed to make them appear individually. Unfortunately, they all
35
  注意: 在`文本`栏中输入更多的文本,可以让预测更准确哦!
36
  """)
37
  t2 = gr.Textbox(lines=5, label='文本',
38
- value="整体呈现 U 字形。左边叫做收缩路径(contracting path)主要max pool 下采样,同时通道数增加右边扩张路径(expansive path),用反卷积( up-convolution )做上采样,恢复图像尺寸最后采用1\times1的卷积层代替全连接层输出。")
39
  button2 = gr.Button("🤖 预测!")
40
  label2 = gr.Textbox(lines=1, label='预测结果 🎃')
41
  score2 = gr.Textbox(lines=1, label='模型概率')
 
11
 
12
  def predict_en(text):
13
  res = pipeline_en(text)[0]
14
+ return "ChatGPT" if res['label'] == "LABEL_1" else "human", res['score']
15
 
16
 
17
  def predict_zh(text):
18
  res = pipeline_zh(text)[0]
19
+ return "ChatGPT" if res['label'] == "LABEL_1" else "human", res['score']
20
 
21
 
22
  with gr.Blocks() as demo:
 
25
  Note: Providing more text to the `Text` box can make the prediction more accurate!
26
  """)
27
  t1 = gr.Textbox(lines=5, label='Text',
28
+ value="There are a few things that can help protect your credit card information from being misused when you give it to a restaurant or any other business:\n\nEncryption: Many businesses use encryption to protect your credit card information when it is being transmitted or stored. This means that the information is transformed into a code that is difficult for anyone to read without the right key.")
 
29
  button1 = gr.Button("🤖 Predict!")
30
  label1 = gr.Textbox(lines=1, label='Predicted Label 🎃')
31
  score1 = gr.Textbox(lines=1, label='Prob')
 
34
  注意: 在`文本`栏中输入更多的文本,可以让预测更准确哦!
35
  """)
36
  t2 = gr.Textbox(lines=5, label='文本',
37
+ value="对于OpenAI大力出奇迹的工作自然每个人都有自己的看点。我自己最欣赏的地方ChatGPT如何解决 “AI校正(Alignment)“这个问题这个问题也我们课题组这两年在探索学术问题之一。")
38
  button2 = gr.Button("🤖 预测!")
39
  label2 = gr.Textbox(lines=1, label='预测结果 🎃')
40
  score2 = gr.Textbox(lines=1, label='模型概率')