Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
auth_token = "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"
|
4 |
-
|
5 |
|
6 |
def predict_en(text):
|
7 |
-
res =
|
8 |
return res['label'],res['score']
|
9 |
|
10 |
with gr.Blocks() as demo:
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
|
5 |
auth_token = "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"
|
6 |
+
pipeline_en = pipeline(task="text-classification", model="Hello-SimpleAI/chatgpt-detector-single",use_auth_token=auth_token)
|
7 |
|
8 |
def predict_en(text):
|
9 |
+
res = pipeline_en(text)[0]
|
10 |
return res['label'],res['score']
|
11 |
|
12 |
with gr.Blocks() as demo:
|