Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
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="
|
| 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="
|
| 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='模型概率')
|