connecting video to qwen2

This commit is contained in:
Miquel Farre 2024-11-14 10:48:18 +00:00 committed by drbh
parent da644c21e5
commit b4e096c080
2 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,7 @@ scipy==1.13.1 ; python_version >= "3.9" and python_version < "3.13"
sentencepiece==0.2.0 ; python_version >= "3.9" and python_version < "3.13"
setuptools==75.2.0 ; python_version >= "3.9" and python_version < "3.13"
tokenizers==0.20.1 ; python_version >= "3.9" and python_version < "3.13"
torchvision==0.19.1 ; python_version >= "3.9" and python_version < "3.13"
tqdm==4.66.5 ; python_version >= "3.9" and python_version < "3.13"
transformers==4.46.0 ; python_version >= "3.9" and python_version < "3.13"
typer==0.6.1 ; python_version >= "3.9" and python_version < "3.13"

View File

@ -211,6 +211,9 @@ class VlmCausalLMBatch(FlashCausalLMBatch):
processor, image_inputs, config, image_id
)
image_id += 1
elif chunk_type == "video" and config.model_type == "qwen2_vl":
# Based on Qwen2VL's video token format
full_text += f"<video>{chunk.video}</video>"
full_text = image_text_replacement_fixup(config, full_text)