[model] fix dsv3 leaf node (#7879)

This commit is contained in:
hoshi-hiyouga
2025-04-28 18:11:09 +08:00
committed by GitHub
parent d173cb50f5
commit 3ae5da2a04
2 changed files with 12 additions and 7 deletions

View File

@@ -1671,7 +1671,9 @@ class Qwen2OmniPlugin(Qwen2VLPlugin):
if num_video_tokens >= len(videos):
raise ValueError(f"`len(videos)` is less than the number of {VIDEO_PLACEHOLDER} tokens.")
video_seqlen = video_grid_thw[num_video_tokens].prod() // merge_length if self.expand_mm_tokens else 1
video_seqlen = (
video_grid_thw[num_video_tokens].prod() // merge_length if self.expand_mm_tokens else 1
)
content = content.replace(
VIDEO_PLACEHOLDER, f"<|vision_bos|>{self.video_token * video_seqlen}<|vision_eos|>", 1
)