rationalsolver commited on
Commit
8903b7b
1 Parent(s): 137590f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -1,3 +1,17 @@
1
- import gradio as gr
 
2
 
3
- gr.load("models/openai-community/roberta-base-openai-detector").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Load the model pipeline
2
+ detector = pipeline("text-classification", model="openai-community/roberta-large-openai-detector")
3
 
4
+ # Define a function for detection
5
+ def detect_ai_content(text):
6
+ result = detector(text)
7
+ return result
8
+
9
+ # Create a Gradio interface
10
+ iface = gr.Interface(
11
+ fn=detect_ai_content,
12
+ inputs="text",
13
+ outputs="json",
14
+ title="AI Content Detector"
15
+ )
16
+
17
+ iface.launch()