doc: emphasize and notify the usage of chat_template (#3589)

Co-authored-by: Chayenne <zhaochen20@outlook.com>
This commit is contained in:
Mick
2025-02-15 16:10:32 +08:00
committed by GitHub
parent 7443197a63
commit 7711ac6ed0
6 changed files with 41 additions and 13 deletions

View File

@@ -353,7 +353,6 @@ register_chat_template(
)
)
register_chat_template(
ChatTemplate(
name="deepseek-v3",
@@ -428,12 +427,13 @@ def match_chat_ml(model_path: str):
if "tinyllama" in model_path:
return get_chat_template("chatml")
# Now the suffix for qwen2 chat model is "instruct"
if (
"qwen" in model_path
and ("chat" in model_path or "instruct" in model_path)
and ("llava" not in model_path)
):
return get_chat_template("qwen")
if "qwen" in model_path:
if "vl" in model_path:
return get_chat_template("qwen2-vl")
if ("chat" in model_path or "instruct" in model_path) and (
"llava" not in model_path
):
return get_chat_template("qwen")
if (
"llava-v1.6-34b" in model_path
or "llava-v1.6-yi-34b" in model_path
@@ -459,6 +459,13 @@ def match_gemma_it(model_path: str):
return get_chat_template("gemma-it")
@register_chat_template_matching_function
def match_openbmb_minicpm(model_path: str):
model_path = model_path.lower()
if "minicpm" in model_path:
return get_chat_template("minicpmv")
@register_chat_template_matching_function
def match_c4ai_command_r(model_path: str):
model_path = model_path.lower()