Spaces:
Sleeping
Sleeping
updated refusal_prompt to use chatpromptTemplate
Browse files- 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 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
| 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:
|