Spaces:
Running
Running
a few error fixes
Browse files- multi_agent_debate.py +4 -3
multi_agent_debate.py
CHANGED
@@ -477,7 +477,7 @@ class MultiAgentDebate:
|
|
477 |
if initialization:
|
478 |
print("ROUND %s: (This is the initialization round where agents are assigned initial stance as their beliefs.)\n"%str(round_counter+1))
|
479 |
for n in range(len(agents_responses)):
|
480 |
-
|
481 |
print("----------------------------------------------------")
|
482 |
round_counter += 1
|
483 |
print("ROUND %s:\n"%str(round_counter+1))
|
@@ -516,7 +516,8 @@ class MultiAgentDebate:
|
|
516 |
while label!="Unknown" and label_val != label_list[n][0] and rep_ctr != 1:
|
517 |
llm_response, _ = self.make_openai_api_call(prompt, model_name, 1)
|
518 |
argument, label = self.parse_output_w_chat_label(llm_response)
|
519 |
-
|
|
|
520 |
writer("Agent %s's Assessment:\n"%str(n+1) + '%s. \n'%strlabel, 'Explanation: %s'%argument + "\n")
|
521 |
print("***************")
|
522 |
rep_ctr += 1
|
@@ -609,7 +610,7 @@ class MultiAgentDebate:
|
|
609 |
# print(llm_response)
|
610 |
# print("***************")
|
611 |
argument, label = self.parse_output_w_chat_label(llm_response)
|
612 |
-
strlabel = "Support" if label == 1 else "Refute"
|
613 |
writer("Agent %s's Assessment: \n"%str(n+1) + '%s. \n'%strlabel, 'Explanation: %s'%argument + "\n")
|
614 |
print("***************")
|
615 |
if label != "Unknown":
|
|
|
477 |
if initialization:
|
478 |
print("ROUND %s: (This is the initialization round where agents are assigned initial stance as their beliefs.)\n"%str(round_counter+1))
|
479 |
for n in range(len(agents_responses)):
|
480 |
+
writer("Agent %s: "%str(n+1) + agents_responses[n] + "\n", "This is my initial belief.")
|
481 |
print("----------------------------------------------------")
|
482 |
round_counter += 1
|
483 |
print("ROUND %s:\n"%str(round_counter+1))
|
|
|
516 |
while label!="Unknown" and label_val != label_list[n][0] and rep_ctr != 1:
|
517 |
llm_response, _ = self.make_openai_api_call(prompt, model_name, 1)
|
518 |
argument, label = self.parse_output_w_chat_label(llm_response)
|
519 |
+
print(f">>>>>>>\n\t{label}\n")
|
520 |
+
strlabel = "Support" if label == "1" else "Refute"
|
521 |
writer("Agent %s's Assessment:\n"%str(n+1) + '%s. \n'%strlabel, 'Explanation: %s'%argument + "\n")
|
522 |
print("***************")
|
523 |
rep_ctr += 1
|
|
|
610 |
# print(llm_response)
|
611 |
# print("***************")
|
612 |
argument, label = self.parse_output_w_chat_label(llm_response)
|
613 |
+
strlabel = "Support" if label == "1" else "Refute"
|
614 |
writer("Agent %s's Assessment: \n"%str(n+1) + '%s. \n'%strlabel, 'Explanation: %s'%argument + "\n")
|
615 |
print("***************")
|
616 |
if label != "Unknown":
|