tanveeshsingh commited on
Commit
5d3c494
1 Parent(s): 641d337

Changes for conversation format

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -30,6 +30,8 @@ def convert_to_message_array(conversation):
30
  message_array.append({'role': 'user', 'content': line.replace('user:', '').strip()})
31
  elif line.startswith('assistant:'):
32
  message_array.append({'role': 'assistant', 'content': line.replace('assistant:', '').strip()})
 
 
33
  def update_inputs(input_style):
34
  if input_style == "Dialog":
35
  return gr.update(visible=True), gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
@@ -82,6 +84,7 @@ Your output should be in JSON FORMAT with the keys "REASONING" and "SCORE":
82
  async def judge_reliability(input_style, document, conversation, claim, question, answer):
83
  start_time = time.time()
84
  if input_style == "Dialog":
 
85
  conversation = convert_to_message_array(conversation=conversation)
86
  print(conversation)
87
  outputs= await collinear.judge.veritas.conversation(document,conversation[:-1],conversation[-1])
 
30
  message_array.append({'role': 'user', 'content': line.replace('user:', '').strip()})
31
  elif line.startswith('assistant:'):
32
  message_array.append({'role': 'assistant', 'content': line.replace('assistant:', '').strip()})
33
+ return message_array
34
+
35
  def update_inputs(input_style):
36
  if input_style == "Dialog":
37
  return gr.update(visible=True), gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
 
84
  async def judge_reliability(input_style, document, conversation, claim, question, answer):
85
  start_time = time.time()
86
  if input_style == "Dialog":
87
+ print(conversation)
88
  conversation = convert_to_message_array(conversation=conversation)
89
  print(conversation)
90
  outputs= await collinear.judge.veritas.conversation(document,conversation[:-1],conversation[-1])