mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Feature] add custom chat template (#3251)
* add custom chat_template * add custom chat_template * add unittest * fix * add docs * fix comment * add offline chat * fix unit test * fix unit test * fix * fix pre commit * fix unit test * add unit test * add unit test * add unit test * fix pre_commit * fix enable_thinking * fix pre commit * fix pre commit * fix unit test * add requirements
This commit is contained in:
@@ -87,6 +87,7 @@ class ErnieProcessor(BaseDataProcessor):
|
||||
bool: Whether preprocessing is successful
|
||||
str: error message
|
||||
"""
|
||||
request.chat_template = kwargs.get("chat_template")
|
||||
request = self._apply_default_parameters(request)
|
||||
if request.get("eos_token_ids") is None or len(request.eos_token_ids) == 0:
|
||||
request.eos_token_ids = self.eos_token_ids
|
||||
@@ -342,6 +343,7 @@ class ErnieProcessor(BaseDataProcessor):
|
||||
tokenize=False,
|
||||
split_special_tokens=False,
|
||||
add_special_tokens=False,
|
||||
chat_template=request_or_messages.get("chat_template", None),
|
||||
)
|
||||
request_or_messages["text_after_process"] = spliced_message
|
||||
req_id = None
|
||||
|
Reference in New Issue
Block a user