Phoenix21 commited on
Commit
a478466
·
verified ·
1 Parent(s): 6d6c216

updated refusal_prompt to use chatpromptTemplate

Browse files
Files changed (1) hide show
  1. prompts.py +9 -4
prompts.py CHANGED
@@ -72,11 +72,16 @@ cleaner_prompt = PromptTemplate(
72
  template=cleaner_prompt_str,
73
  input_variables=["kb_answer", "web_answer"]
74
  )
75
-
76
- refusal_prompt = PromptTemplate(
77
- template=refusal_prompt_str,
78
- input_variables=["topic"]
 
79
  )
 
 
 
 
80
 
81
  # Define function to check if the query contains harmful topics
82
  def is_harmful(query: str) -> bool:
 
72
  template=cleaner_prompt_str,
73
  input_variables=["kb_answer", "web_answer"]
74
  )
75
+ refusal_prompt=ChatPromptTemplate(
76
+ [
77
+ ("system",refusal_prompt_str),
78
+ ("user","{topic}")
79
+ ]
80
  )
81
+ # refusal_prompt = PromptTemplate(
82
+ # template=refusal_prompt_str,
83
+ # input_variables=["topic"]
84
+ # )
85
 
86
  # Define function to check if the query contains harmful topics
87
  def is_harmful(query: str) -> bool: