Spaces:
showme
/
Running

d5 / app.py
showme's picture
Update app.py
08c2de9 verified
raw
history blame
374 Bytes
import gradio as gr
from transformers import pipeline
# 加载模型
sentiment_model = pipeline("text-classification", model="Hello-SimpleAI/chatgpt-detector-roberta")
def predict(text):
return sentiment_model(text)
# 构建 UI
interface = gr.Interface(
fn=predict,
inputs="text",
outputs="text",
title="chatgpt-detector-roberta"
)
interface.launch()