0xhimzel commited on
Commit
63254a4
1 Parent(s): cc4e73d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,10 +1,12 @@
1
  import gradio as gr
 
 
2
 
3
  auth_token = "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"
4
- model = gr.Interface.load("models/Hello-SimpleAI/chatgpt-detector-roberta", api_key=auth_token)
5
 
6
  def predict_en(text):
7
- res = model(text)[0]
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: