VLM: enhance VL embedding model with video input support and revise warm-up strategy (#16635)

Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
yuhao
2026-01-08 22:12:01 +08:00
committed by GitHub
parent 20ca2c6e1e
commit d2ea44f775
5 changed files with 18 additions and 4 deletions

View File

@@ -510,11 +510,11 @@ def chat_template_exists(template_name: str) -> bool:
def generate_embedding_convs(
texts: List[str], images: List[str], template_name: str
texts: List[str], images: List[str], videos: List[str], template_name: str
) -> List[Conversation]:
conv_template = chat_templates[template_name].copy()
convs = []
for text, image in zip(texts, images):
for text, image, video in zip(texts, images, videos):
conv = Conversation(
name=conv_template.name,
system_template=conv_template.system_template,
@@ -544,6 +544,8 @@ def generate_embedding_convs(
else conv.image_token
)
real_content += image_token
if video is not None:
real_content += conv.video_token
if text is not None:
real_content += text
conv.append_message(conv.roles[0], real_content)