"examples/vscode:/vscode.git/clone" did not exist on "2389df81555ae4cc9b819393282d24eb1440dfbc"
Unverified Commit cf9d8efd authored by Enrique Shockwave's avatar Enrique Shockwave Committed by GitHub
Browse files

llama3 instruct template (#372)

parent 1bf1cf19
...@@ -162,6 +162,28 @@ register_chat_template( ...@@ -162,6 +162,28 @@ register_chat_template(
) )
) )
register_chat_template(
ChatTemplate(
name="llama-3-instruct",
default_system_prompt=None,
role_prefix_and_suffix={
"system": (
"<|start_header_id|>system<|end_header_id|>\n\n",
"<|eot_id|>",
),
"user": (
"<|start_header_id|>user<|end_header_id|>\n\n",
"<|eot_id|>",
),
"assistant": (
"<|start_header_id|>assistant<|end_header_id|>\n\n",
"<|eot_id|>",
),
},
stop_str=("<|eot_id|>",),
)
)
# Reference: https://github.com/01-ai/Yi/tree/main/VL#major-difference-with-llava # Reference: https://github.com/01-ai/Yi/tree/main/VL#major-difference-with-llava
register_chat_template( register_chat_template(
ChatTemplate( ChatTemplate(
...@@ -233,6 +255,13 @@ def match_llama2_chat(model_path: str): ...@@ -233,6 +255,13 @@ def match_llama2_chat(model_path: str):
return get_chat_template("llama-2-chat") return get_chat_template("llama-2-chat")
@register_chat_template_matching_function
def match_llama3_instruct(model_path: str):
model_path = model_path.lower()
if "llama-3" in model_path and "instruct" in model_path:
return get_chat_template("llama-3-instruct")
@register_chat_template_matching_function @register_chat_template_matching_function
def match_chat_ml(model_path: str): def match_chat_ml(model_path: str):
model_path = model_path.lower() model_path = model_path.lower()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment