model: Support Janus-pro (#3203)
This commit is contained in:
@@ -230,6 +230,29 @@ register_chat_template(
|
||||
)
|
||||
)
|
||||
|
||||
register_chat_template(
|
||||
ChatTemplate(
|
||||
name="janus-pro",
|
||||
default_system_prompt=None,
|
||||
role_prefix_and_suffix={
|
||||
"system": (
|
||||
"",
|
||||
"",
|
||||
),
|
||||
"User": (
|
||||
"<|User|>",
|
||||
"",
|
||||
),
|
||||
"assistant": (
|
||||
"<|Assistant|>",
|
||||
"<|end▁of▁sentence|>",
|
||||
),
|
||||
},
|
||||
stop_str=("<|end▁of▁sentence|>",),
|
||||
image_token="<image_placeholder>\n",
|
||||
)
|
||||
)
|
||||
|
||||
# The difference between "llama-3-instruct-llava" and "llama-3-instruct" is that llava uses a different image_token.
|
||||
register_chat_template(
|
||||
ChatTemplate(
|
||||
@@ -384,6 +407,12 @@ def match_deepseek(model_path: str):
|
||||
return get_chat_template("deepseek-v3")
|
||||
|
||||
|
||||
@register_chat_template_matching_function
|
||||
def match_deepseek_janus_pro(model_path: str):
|
||||
if "janus" in model_path.lower():
|
||||
return get_chat_template("janus-pro")
|
||||
|
||||
|
||||
@register_chat_template_matching_function
|
||||
def match_dbrx(model_path: str):
|
||||
if "dbrx" in model_path.lower() and "instruct" in model_path.lower():
|
||||
|
||||
Reference in New Issue
Block a user