import gradio as gr | |
from transformers import pipeline | |
# Load the model | |
pipe = pipeline("text-classification", model="Hello-SimpleAI/chatgpt-detector-roberta-chinese") | |
def classify_text(text): | |
results = pipe(text) | |
return results | |
# Create Gradio interface | |
iface = gr.Interface(fn=classify_text, inputs="text", outputs="json", title="Text Classification", description="Classify text using the Hello-SimpleAI/chatgpt-detector-roberta-chinese model") | |
iface.launch(share=True) | |