rusen commited on
Commit
b36d5c8
·
1 Parent(s): 4b0a2c8

debugging 1

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 = np.argmax(roberta_base_detector(text)[0]['label'].to('cpu'))
13
- chatgpt_lli_hc3_pred = np.argmax(chatgpt_lli_hc3_detector(text)[0]['label'].to('cpu'))
14
- chatgpt_roberta_pred = np.argmax(chatgpt_roberta_detector(text)[0]['label'].to('cpu'))
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 "AI"
27
  else:
28
- return "Human"
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(