Spaces:
Runtime error
Runtime error
File size: 2,571 Bytes
f7709d8 1aec58d f7709d8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
from modules.gpt_modules import gpt_call
from langchain.prompts import PromptTemplate
def debate_judgement(
judgement_who,
user_debate_history,
bot_debate_history
):
if judgement_who == 'User-Bot':
judgement_prompt_preset = "\n".join([
"!!Instruction!",
"You are now the judge of this debate. Evaluate the debate according to the rules below.",
"Rule 1. Decide between the USER and BOT.",
"Rule 2. Summarize the debate as a whole and what each debater said.",
"Rule 3. For each debater, explain what was persuasive and what made the differnce between winning and losing.",
])
judgement_prompt = "\n".join([
judgement_prompt_preset,
"User: " + user_debate_history,
"Bot: " + bot_debate_history,
"Judgement must be logical with paragraphs.",
"Do not show Rule",
"Write judgement below.",
"Judgement: "
])
elif judgement_who == 'User':
judgement_prompt_preset = "\n".join([
"!!Instruction!",
"You are now the judge of this debate. Evaluate the debate according to the rules below.",
"Rule 1. Summarize the debate as a whole and each said.",
"Rule 2. Explain what was persuasive and what made the differnce between winning and losing.",
])
judgement_prompt = "\n".join([
judgement_prompt_preset,
"User: " + user_debate_history,
"Judgement must be logical with paragraphs.",
"Do not show Rule",
"Write judgement below.",
"Judgement: "
])
elif judgement_who == 'Bot':
judgement_prompt_preset = "\n".join([
"!!Instruction!",
"You are now the judge of this debate. Evaluate the debate according to the rules below.",
"Rule 1. Summarize the debate as a whole and each said.",
"Rule 2. Explain what was persuasive and what made the differnce between winning and losing.",
])
judgement_prompt = "\n".join([
judgement_prompt_preset,
"Bot: " + bot_debate_history,
"Judgement must be logical with paragraphs.",
"Do not show Rule",
"Write judgement below.",
"Judgement: "
])
bot_response = gpt_call(judgement_prompt)
return bot_response |