michaelmc1618 commited on
Commit
ca6a317
·
verified ·
1 Parent(s): fe927e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -67,17 +67,23 @@ def generate_case_outcome(prosecutor_response, defense_response):
67
  return evaluation
68
 
69
  def determine_winner(outcome):
 
 
70
  if "Prosecutor" in outcome and "Defense" in outcome:
71
  if outcome.count("Prosecutor") > outcome.count("Defense"):
72
- return "Prosecutor Wins"
73
  else:
74
- return "Defense Wins"
75
  elif "Prosecutor" in outcome:
76
- return "Prosecutor Wins"
77
  elif "Defense" in outcome:
78
- return "Defense Wins"
79
  else:
80
- return "No clear winner"
 
 
 
 
81
 
82
  def chat_between_bots(system_message1, system_message2, max_tokens, temperature, top_p, history1, history2, shared_history, message):
83
  prosecutor_response, history1 = respond(message, history1, system_message1, max_tokens, temperature, top_p)
 
67
  return evaluation
68
 
69
  def determine_winner(outcome):
70
+ # Here, we extract the necessary details to declare the winner
71
+ winner = ""
72
  if "Prosecutor" in outcome and "Defense" in outcome:
73
  if outcome.count("Prosecutor") > outcome.count("Defense"):
74
+ winner = "Prosecutor Wins"
75
  else:
76
+ winner = "Defense Wins"
77
  elif "Prosecutor" in outcome:
78
+ winner = "Prosecutor Wins"
79
  elif "Defense" in outcome:
80
+ winner = "Defense Wins"
81
  else:
82
+ winner = "No clear winner"
83
+
84
+ # Append detailed results from the verified source
85
+ detailed_result = "Detailed result: " + outcome
86
+ return winner + "\n\n" + detailed_result
87
 
88
  def chat_between_bots(system_message1, system_message2, max_tokens, temperature, top_p, history1, history2, shared_history, message):
89
  prosecutor_response, history1 = respond(message, history1, system_message1, max_tokens, temperature, top_p)