Spaces:
Running
Running
debugging 1
Browse files
app.py
CHANGED
@@ -9,9 +9,9 @@ chatgpt_roberta_detector = pipeline("text-classification", model="Models/fine_tu
|
|
9 |
|
10 |
def classify_text(text):
|
11 |
# Get predictions from each model
|
12 |
-
roberta_base_pred =
|
13 |
-
chatgpt_lli_hc3_pred =
|
14 |
-
chatgpt_roberta_pred =
|
15 |
|
16 |
# Count the votes for AI and Human
|
17 |
votes = {"AI": 0, "Human": 0}
|
@@ -23,9 +23,9 @@ def classify_text(text):
|
|
23 |
|
24 |
# Determine final decision based on majority
|
25 |
if votes["AI"] > votes["Human"]:
|
26 |
-
return
|
27 |
else:
|
28 |
-
return
|
29 |
|
30 |
# Create Gradio Interface
|
31 |
iface = gr.Interface(
|
|
|
9 |
|
10 |
def classify_text(text):
|
11 |
# Get predictions from each model
|
12 |
+
roberta_base_pred = roberta_base_detector(text)[0]['label']
|
13 |
+
chatgpt_lli_hc3_pred = chatgpt_lli_hc3_detector(text)[0]['label']
|
14 |
+
chatgpt_roberta_pred = chatgpt_roberta_detector(text)[0]['label']
|
15 |
|
16 |
# Count the votes for AI and Human
|
17 |
votes = {"AI": 0, "Human": 0}
|
|
|
23 |
|
24 |
# Determine final decision based on majority
|
25 |
if votes["AI"] > votes["Human"]:
|
26 |
+
return roberta_base_pred
|
27 |
else:
|
28 |
+
return roberta_base_pred
|
29 |
|
30 |
# Create Gradio Interface
|
31 |
iface = gr.Interface(
|