# Load the model pipeline
detector = pipeline("text-classification", model="openai-community/roberta-large-openai-detector")

# Define a function for detection
def detect_ai_content(text):
    result = detector(text)
    return result

# Create a Gradio interface
iface = gr.Interface(
    fn=detect_ai_content,
    inputs="text",
    outputs="json",
    title="AI Content Detector"
)

iface.launch()