Rename handler.py to handler2.py
Browse files- handler.py → handler2.py +2 -0
handler.py → handler2.py
RENAMED
|
@@ -65,6 +65,7 @@ class EndpointHandler:
|
|
| 65 |
|
| 66 |
# Define the policy prompt for safety evaluation
|
| 67 |
self.policy_prompt = self._get_policy_prompt()
|
|
|
|
| 68 |
|
| 69 |
def _get_policy_prompt(self):
|
| 70 |
return """Check if there is unsafe content in the user or agent messages in the
|
|
@@ -219,6 +220,7 @@ class EndpointHandler:
|
|
| 219 |
# Format input with the conversation template based on model type
|
| 220 |
formatted_input = f"Please assess the following conversation: {input_text}"
|
| 221 |
conversation = self._format_conversations(formatted_input)
|
|
|
|
| 222 |
|
| 223 |
# Apply the chat template to prepare for the model
|
| 224 |
if hasattr(self.tokenizer, "apply_chat_template"):
|
|
|
|
| 65 |
|
| 66 |
# Define the policy prompt for safety evaluation
|
| 67 |
self.policy_prompt = self._get_policy_prompt()
|
| 68 |
+
|
| 69 |
|
| 70 |
def _get_policy_prompt(self):
|
| 71 |
return """Check if there is unsafe content in the user or agent messages in the
|
|
|
|
| 220 |
# Format input with the conversation template based on model type
|
| 221 |
formatted_input = f"Please assess the following conversation: {input_text}"
|
| 222 |
conversation = self._format_conversations(formatted_input)
|
| 223 |
+
self.tokenizer.chat_template = self.chat_template
|
| 224 |
|
| 225 |
# Apply the chat template to prepare for the model
|
| 226 |
if hasattr(self.tokenizer, "apply_chat_template"):
|