Spaces:
Runtime error
Runtime error
Commit
·
9033977
1
Parent(s):
71bcc97
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
auth_token = "
|
6 |
pipeline_en = pipeline(task="text-classification", model="Hello-SimpleAI/chatgpt-detector-roberta",use_auth_token=auth_token)
|
7 |
|
8 |
|
@@ -14,18 +14,15 @@ def predict_en(text):
|
|
14 |
|
15 |
|
16 |
with gr.Blocks() as demo:
|
17 |
-
gr.Markdown(""
|
18 |
-
|
19 |
-
Paste in the text you want to check and get a holistic score for how much of the document is written by AI. We recommend that educators take these results as one of many pieces in their assessment of student work. This model is based on Hello Simple's paper [arxiv: 2301.07597](https://arxiv.org/abs/2301.07597) and Github project [Hello-SimpleAI/chatgpt-comparison-detection](https://github.com/Hello-SimpleAI/chatgpt-comparison-detection).
|
20 |
-
""")
|
21 |
-
with gr.Tab("Try it out 👇"):
|
22 |
gr.Markdown("""
|
23 |
Note: Providing more text to the `Text` box can make the prediction more accurate!
|
24 |
""")
|
25 |
-
t1 = gr.Textbox(lines=5, label='Paste the text you want to check',value="
|
26 |
button1 = gr.Button("👀 See results")
|
27 |
score1 = gr.Textbox(lines=1, label='There is a')
|
28 |
-
label1 = gr.Textbox(lines=1, label='That this text is written
|
29 |
|
30 |
button1.click(predict_en, inputs=[t1], outputs=[score1, label1])
|
31 |
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
auth_token = os.environ.get("access_token")
|
6 |
pipeline_en = pipeline(task="text-classification", model="Hello-SimpleAI/chatgpt-detector-roberta",use_auth_token=auth_token)
|
7 |
|
8 |
|
|
|
14 |
|
15 |
|
16 |
with gr.Blocks() as demo:
|
17 |
+
gr.Markdown("AI Content Sentinel")
|
18 |
+
with gr.Tab("Check Your Content For AI Plagiarism"):
|
|
|
|
|
|
|
19 |
gr.Markdown("""
|
20 |
Note: Providing more text to the `Text` box can make the prediction more accurate!
|
21 |
""")
|
22 |
+
t1 = gr.Textbox(lines=5, label='Paste the text you want to check',value="Paste Your Content Here")
|
23 |
button1 = gr.Button("👀 See results")
|
24 |
score1 = gr.Textbox(lines=1, label='There is a')
|
25 |
+
label1 = gr.Textbox(lines=1, label='That this text is written by a')
|
26 |
|
27 |
button1.click(predict_en, inputs=[t1], outputs=[score1, label1])
|
28 |
|