muqtasid87 commited on
Commit
2bc2c0d
·
verified ·
1 Parent(s): 86179aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -38,7 +38,7 @@ def call_bots(bot_num, system, opinion, bot1_messages, bot2_messages, model="met
38
  prompt,
39
  model=model,
40
  stream=True,
41
- max_new_tokens=200,
42
  temperature=0.7,
43
  repetition_penalty=1.2,
44
  stop_sequences=["<|eot_id|>", "<|end_of_text|>"]
@@ -115,10 +115,10 @@ Follow these RULES:
115
  ```"""
116
 
117
  def stream_debate(opinion1, opinion2, num_rounds):
118
- system_prompt_1 = f"""You are snarky and argumentative. Keep responses under 3 sentences.
119
  Support {opinion1} and oppose {opinion2}. Use logical arguments. No civility. Argue in the style of online arguments"""
120
 
121
- system_prompt_2 = f"""You are snarky and argumentative. Keep responses under 3 sentences.
122
  Support {opinion2} and oppose {opinion1}. Use logical arguments. No civility. Argue in the style of online arguments"""
123
 
124
  bot1_history = [opinion1]
@@ -197,14 +197,14 @@ with gr.Blocks(title="🤖⚔️ Debate Arena", css="""
197
  }
198
  /* ... (keep other existing CSS rules) */
199
  """) as demo:
200
- gr.Markdown("# 🤖⚔️🤖 AI Debate Arena\nInput any opinion for Bot 1 and Bot 2 and select the number of rounds. After the argument is finished, a third AI will pick the winner. (May have to scroll down on mobile devices.)", elem_classes=["mobile-pad"])
201
 
202
  with gr.Row(elem_classes=["mobile-stack"]):
203
  with gr.Column(scale=2, elem_classes=["mobile-full"]):
204
  bot1_input = gr.Textbox(label="Bot 1 Opinion", value=opinion_1, elem_classes=["mobile-full"])
205
  bot2_input = gr.Textbox(label="Bot 2 Opinion", value=opinion_2, elem_classes=["mobile-full"])
206
  with gr.Column(scale=1, elem_classes=["mobile-full"]):
207
- rounds = gr.Number(label="Debate Rounds", value=3, precision=0, minimum=1, maximum=500)
208
  start_btn = gr.Button("Start Debate!", variant="primary", elem_classes=["mobile-full"])
209
 
210
  with gr.Row(elem_classes=["mobile-stack"]):
 
38
  prompt,
39
  model=model,
40
  stream=True,
41
+ max_new_tokens=300,
42
  temperature=0.7,
43
  repetition_penalty=1.2,
44
  stop_sequences=["<|eot_id|>", "<|end_of_text|>"]
 
115
  ```"""
116
 
117
  def stream_debate(opinion1, opinion2, num_rounds):
118
+ system_prompt_1 = f"""You are snarky and argumentative. Keep responses short and under 3 sentences.
119
  Support {opinion1} and oppose {opinion2}. Use logical arguments. No civility. Argue in the style of online arguments"""
120
 
121
+ system_prompt_2 = f"""You are snarky and argumentative. Keep responses short and under 3 sentences.
122
  Support {opinion2} and oppose {opinion1}. Use logical arguments. No civility. Argue in the style of online arguments"""
123
 
124
  bot1_history = [opinion1]
 
197
  }
198
  /* ... (keep other existing CSS rules) */
199
  """) as demo:
200
+ gr.Markdown("# 🤖⚔️🤖 AI Debate Arena\nInput any opinion for Bot 1 and Bot 2 and select the number of rounds. After the argument is finished, a third Bot will pick the winner. (May have to scroll down to view on mobile devices.)", elem_classes=["mobile-pad"])
201
 
202
  with gr.Row(elem_classes=["mobile-stack"]):
203
  with gr.Column(scale=2, elem_classes=["mobile-full"]):
204
  bot1_input = gr.Textbox(label="Bot 1 Opinion", value=opinion_1, elem_classes=["mobile-full"])
205
  bot2_input = gr.Textbox(label="Bot 2 Opinion", value=opinion_2, elem_classes=["mobile-full"])
206
  with gr.Column(scale=1, elem_classes=["mobile-full"]):
207
+ rounds = gr.Number(label="Number of Rounds", value=3, precision=0, minimum=1, maximum=500)
208
  start_btn = gr.Button("Start Debate!", variant="primary", elem_classes=["mobile-full"])
209
 
210
  with gr.Row(elem_classes=["mobile-stack"]):