Unggi commited on
Commit
95bd3fa
1 Parent(s): 38840ef

debate prototype 1.1 complete

Browse files
Files changed (1) hide show
  1. bots/debate_bot.py +8 -0
bots/debate_bot.py CHANGED
@@ -86,6 +86,8 @@ def debate_bot(prompt, history="", debate_subject="", bot_role="", history_num=0
86
  # preprocess
87
  # if first_response contain the first debater for the con side's opinion, remove it.
88
  first_response = erase_start_word_and_after(first_response, debate_role[1])
 
 
89
 
90
  #first_response = re.sub(debate_role[1] + ":.*", "", first_response)
91
 
@@ -135,9 +137,12 @@ def debate_bot(prompt, history="", debate_subject="", bot_role="", history_num=0
135
  # preprocess
136
  # if first_response contain the first debater for the con side's opinion, remove it.
137
  first_response = erase_start_word_and_after(first_response, debate_role[1])
 
 
138
  # if second_response contain the first debater for the con side's opinion, remove it.
139
  #second_response = re.sub(debate_role[2] + ":.*", "", second_response)
140
  second_response = erase_start_word_and_after(second_response, debate_role[2])
 
141
 
142
  bot_response = "\n".join([
143
  bot_preset + "\n",
@@ -205,9 +210,12 @@ def debate_bot(prompt, history="", debate_subject="", bot_role="", history_num=0
205
  # preprocess
206
  # if first_response contain the first debater for the con side's opinion, remove it.
207
  first_response = erase_start_word_and_after(first_response, debate_role[1])
 
 
208
  # if second_response contain the first debater for the con side's opinion, remove it.
209
  #second_response = re.sub(debate_role[2] + ":.*", "", second_response)
210
  second_response = erase_start_word_and_after(second_response, debate_role[2])
 
211
  # if third_response contain the first debater for the con side's opinion, remove it.
212
  thir_response = erase_start_word_and_after(thir_response, debate_role[3])
213
  #third_response = re.sub(debate_role[3] + ":.*", "", third_response)
 
86
  # preprocess
87
  # if first_response contain the first debater for the con side's opinion, remove it.
88
  first_response = erase_start_word_and_after(first_response, debate_role[1])
89
+ first_response = erase_start_word_and_after(first_response, debate_role[2])
90
+ first_response = erase_start_word_and_after(first_response, debate_role[3])
91
 
92
  #first_response = re.sub(debate_role[1] + ":.*", "", first_response)
93
 
 
137
  # preprocess
138
  # if first_response contain the first debater for the con side's opinion, remove it.
139
  first_response = erase_start_word_and_after(first_response, debate_role[1])
140
+ first_response = erase_start_word_and_after(first_response, debate_role[2])
141
+ first_response = erase_start_word_and_after(first_response, debate_role[3])
142
  # if second_response contain the first debater for the con side's opinion, remove it.
143
  #second_response = re.sub(debate_role[2] + ":.*", "", second_response)
144
  second_response = erase_start_word_and_after(second_response, debate_role[2])
145
+ second_response = erase_start_word_and_after(second_response, debate_role[3])
146
 
147
  bot_response = "\n".join([
148
  bot_preset + "\n",
 
210
  # preprocess
211
  # if first_response contain the first debater for the con side's opinion, remove it.
212
  first_response = erase_start_word_and_after(first_response, debate_role[1])
213
+ first_response = erase_start_word_and_after(first_response, debate_role[2])
214
+ first_response = erase_start_word_and_after(first_response, debate_role[3])
215
  # if second_response contain the first debater for the con side's opinion, remove it.
216
  #second_response = re.sub(debate_role[2] + ":.*", "", second_response)
217
  second_response = erase_start_word_and_after(second_response, debate_role[2])
218
+ second_response = erase_start_word_and_after(second_response, debate_role[3])
219
  # if third_response contain the first debater for the con side's opinion, remove it.
220
  thir_response = erase_start_word_and_after(thir_response, debate_role[3])
221
  #third_response = re.sub(debate_role[3] + ":.*", "", third_response)