tanveeshsingh commited on
Commit
9ce665a
1 Parent(s): 8844699
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -41,7 +41,7 @@ def update_inputs(input_style):
41
  return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True)
42
 
43
 
44
- async def lynx(input_style_dropdown,document_input,question_input,answer_input,collinear_output):
45
  start_time = time.time()
46
  if input_style_dropdown=='QA format':
47
  client = AsyncOpenAI(
@@ -79,12 +79,12 @@ Your output should be in JSON FORMAT with the keys "REASONING" and "SCORE":
79
  else:
80
  results = 'NA'
81
  lynx_time = round(time.time() - start_time, 2) # Calculate time taken for Lynx
82
- await add_to_dataset(input_style_dropdown,document_input,question_input,answer_input,claim_input,results,collinear_output)
83
  return results, lynx_time
84
  # Function to judge reliability based on the selected input format
85
 
86
 
87
- async def add_to_dataset(category,document,question,answer,claim,conv_prefix,lynx_output,veritas_output):
88
  conv_prefix = convert_to_message_array(conv_prefix)
89
  dataset = load_dataset("collinear-ai/veritas-demo-dataset")
90
  new_row = {
@@ -96,7 +96,7 @@ async def add_to_dataset(category,document,question,answer,claim,conv_prefix,lyn
96
  'conv_prefix':conv_prefix[:-1],
97
  'response':conv_prefix[-1],
98
  'lynx_output':lynx_output,
99
- 'veritas_output':veritas_output,
100
  }
101
  train_dataset = dataset['train']
102
 
 
41
  return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=True), gr.update(visible=True)
42
 
43
 
44
+ async def lynx(input_style_dropdown,document_input,question_input,answer_input,result_output):
45
  start_time = time.time()
46
  if input_style_dropdown=='QA format':
47
  client = AsyncOpenAI(
 
79
  else:
80
  results = 'NA'
81
  lynx_time = round(time.time() - start_time, 2) # Calculate time taken for Lynx
82
+ await add_to_dataset(input_style_dropdown,document_input,question_input,answer_input,claim_input,results,result_output)
83
  return results, lynx_time
84
  # Function to judge reliability based on the selected input format
85
 
86
 
87
+ async def add_to_dataset(category,document,question,answer,claim,conv_prefix,lynx_output,result_output):
88
  conv_prefix = convert_to_message_array(conv_prefix)
89
  dataset = load_dataset("collinear-ai/veritas-demo-dataset")
90
  new_row = {
 
96
  'conv_prefix':conv_prefix[:-1],
97
  'response':conv_prefix[-1],
98
  'lynx_output':lynx_output,
99
+ 'veritas_output':result_output,
100
  }
101
  train_dataset = dataset['train']
102