codex / app.py
jithinm's picture
Create app.py
6d4af55 verified
raw
history blame contribute delete
416 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Hello-SimpleAI/chatgpt-detector-roberta-chinese"
)
def detect_ai(text):
result = classifier(text)
return result[0]
demo = gr.Interface(
fn=detect_ai,
inputs=gr.Textbox(lines=5, placeholder="Enter text here..."),
outputs="text",
title="ChatGPT Text Detector"
)
demo.launch()