[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:
luukunn
2025-08-18 16:34:08 +08:00
committed by GitHub
parent 70ee910cd5
commit 9c129813f9
19 changed files with 288 additions and 3 deletions
+3
View File
@@ -160,6 +160,9 @@ repetition_penalty: Optional[float] = None
chat_template_kwargs: Optional[dict] = None
# 传递给聊天模板(chat template)的额外参数,用于自定义对话格式(默认 None)。
chat_template: Optional[str] = None
# 自定义聊天模板,会覆盖模型默认的聊天模板,(默认 None)。
reasoning_max_tokens: Optional[int] = None
# 推理(如 CoT, 思维链)过程中生成的最大 token 数(默认 None 表示使用全局 max_tokens)。