[model] Support POINTSV15Chat (#9651)
Co-authored-by: josephyou <josephyou@tencent.com> Co-authored-by: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com> Co-authored-by: root <root@TENCENT64.site>
This commit is contained in:
@@ -960,6 +960,19 @@ register_conv_template(
|
||||
)
|
||||
)
|
||||
|
||||
register_conv_template(
|
||||
Conversation(
|
||||
name="points-v15-chat",
|
||||
system_message="",
|
||||
system_template="",
|
||||
roles=("<|im_start|>user", "<|im_start|>assistant"),
|
||||
sep="<|im_end|>\n",
|
||||
sep_style=SeparatorStyle.ADD_NEW_LINE_SINGLE,
|
||||
stop_str=["<|im_end|>"],
|
||||
image_token="<|vision_start|><|image_pad|><|vision_end|>",
|
||||
video_token="<|vision_start|><|video_pad|><|vision_end|>",
|
||||
)
|
||||
)
|
||||
|
||||
MODEL_TYPE_TO_TEMPLATE = {
|
||||
"internvl_chat": "internvl-2-5",
|
||||
@@ -971,6 +984,12 @@ MODEL_TYPE_TO_TEMPLATE = {
|
||||
}
|
||||
|
||||
|
||||
@register_conv_template_matching_function
|
||||
def match_points_v15_chat(model_path: str):
|
||||
if re.search(r"points", model_path, re.IGNORECASE):
|
||||
return "points-v15-chat"
|
||||
|
||||
|
||||
def get_model_type(model_path: str) -> Optional[str]:
|
||||
config_path = os.path.join(model_path, "config.json")
|
||||
if not os.path.exists(config_path):
|
||||
|
||||
Reference in New Issue
Block a user