File size: 401 Bytes
8903b7b
 
137590f
8903b7b
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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()