Sarath0x8f commited on
Commit
7a3d85e
·
verified ·
1 Parent(s): 22faf28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -7,12 +7,13 @@ client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
7
 
8
  # Debate response function
9
  def debate_respond(message, history: list[tuple[str, str]],
10
- max_tokens=1024, temperature=0.4, top_p=0.95):
11
  # System message defining assistant behavior in a debate
12
  system_message = {
13
  "role": "system",
14
- "content": f"Act as a debate participant taking the position '{position}' on the topic '{topic}'. Respond professionally, thoughtfully, and convincingly, staying within the specified role."
15
- f"If the user's point challenges your position, provide a counterargument. Maintain a respectful tone throughout the discussion."
 
16
  }
17
 
18
  messages = [system_message]
@@ -49,7 +50,7 @@ def encode_image(image_path):
49
  global topic, position
50
  with gr.Blocks(theme=gr.themes.Ocean(font=[gr.themes.GoogleFont("Roboto Mono")]),
51
  css='footer {visibility: hidden}') as demo:
52
- gr.Markdown("# LLM Debate Participant")
53
  with gr.Tabs():
54
  with gr.TabItem("Debate Interface"):
55
  with gr.Row():
 
7
 
8
  # Debate response function
9
  def debate_respond(message, history: list[tuple[str, str]],
10
+ max_tokens=512, temperature=0.4, top_p=0.95):
11
  # System message defining assistant behavior in a debate
12
  system_message = {
13
  "role": "system",
14
+ "content": f"You are a debate participant tasked with defending the position '{position.value}' on the topic '{topic.value}'. Your goal is to articulate your arguments with clarity, logic, and professionalism while addressing counterpoints made by the opposing side. Ensure that your responses are thoughtful, evidence-based, and persuasive."
15
+ f"During the debate, if the user presents arguments challenging your stance, analyze their points critically and provide respectful but firm counterarguments. Avoid dismissive language and focus on strengthening your case through logical reasoning, data, and examples relevant to the topic."
16
+ f"Stay consistent with your assigned position ('{position.value}'), even if the opposing arguments are strong. Your role is not to concede but to present a compelling case for your stance. Keep the tone respectful and formal throughout the discussion, fostering a constructive and engaging debate environment."
17
  }
18
 
19
  messages = [system_message]
 
50
  global topic, position
51
  with gr.Blocks(theme=gr.themes.Ocean(font=[gr.themes.GoogleFont("Roboto Mono")]),
52
  css='footer {visibility: hidden}') as demo:
53
+ gr.Markdown("# Welcome to The Debate_Master 🗣️🤖")
54
  with gr.Tabs():
55
  with gr.TabItem("Debate Interface"):
56
  with gr.Row():