minko186 commited on
Commit
f1ef701
1 Parent(s): 8fe6e3e

split 1on1 to another option

Browse files
Files changed (2) hide show
  1. app.py +11 -7
  2. predictors.py +0 -1
app.py CHANGED
@@ -13,12 +13,12 @@ np.set_printoptions(suppress=True)
13
  def ai_generated_test(option, input):
14
  if option == "Human vs AI":
15
  return predict_bc_scores(input), None, None
16
- else:
17
- return (
18
- predict_bc_scores(input),
19
- predict_mc_scores(input),
20
- predict_1on1_scores(input),
21
- )
22
 
23
 
24
  # COMBINED
@@ -108,7 +108,11 @@ with gr.Blocks() as demo:
108
  with gr.Row():
109
  with gr.Column():
110
  ai_option = gr.Radio(
111
- ["Human vs AI", "Human vs AI Source Models"],
 
 
 
 
112
  label="Choose an option please.",
113
  )
114
  with gr.Column():
 
13
  def ai_generated_test(option, input):
14
  if option == "Human vs AI":
15
  return predict_bc_scores(input), None, None
16
+ elif option == "Human vs AI Source Models":
17
+ return (predict_bc_scores(input), predict_mc_scores(input), None)
18
+ elif option == "Human vs AI Source Models (1 on 1)":
19
+ return predict_bc_scores(input), None, predict_1on1_scores(input)
20
+
21
+ return None, None, None
22
 
23
 
24
  # COMBINED
 
108
  with gr.Row():
109
  with gr.Column():
110
  ai_option = gr.Radio(
111
+ [
112
+ "Human vs AI",
113
+ "Human vs AI Source Models",
114
+ "Human vs AI Source Models (1 on 1)",
115
+ ],
116
  label="Choose an option please.",
117
  )
118
  with gr.Column():
predictors.py CHANGED
@@ -299,7 +299,6 @@ def predict_1on1_scores(input):
299
  for score, label in zip(mc_score_list, text_1on1_label_map):
300
  mc_score[label.upper()] = score
301
 
302
- print(mc_score)
303
  sum_prob = 1 - bc_score["HUMAN"]
304
  for key, value in mc_score.items():
305
  mc_score[key] = value * sum_prob
 
299
  for score, label in zip(mc_score_list, text_1on1_label_map):
300
  mc_score[label.upper()] = score
301
 
 
302
  sum_prob = 1 - bc_score["HUMAN"]
303
  for key, value in mc_score.items():
304
  mc_score[key] = value * sum_prob