[Fix] Address remaining issues of supporting MiniCPMV (#2977)

This commit is contained in:
Mick
2025-01-28 16:22:13 +08:00
committed by GitHub
parent 76285fdeea
commit 9f635ea50d
12 changed files with 708 additions and 223 deletions

View File

@@ -180,7 +180,9 @@ class TestOpenAIVisionServer(unittest.TestCase):
assert response.usage.total_tokens > 0
def prepare_video_messages(self, video_path):
max_frames_num = 32
# the memory consumed by the Vision Attention varies a lot, e.g. blocked qkv vs full-sequence sdpa
# the size of the video embeds differs from the `modality` argument when preprocessed
max_frames_num = 12
vr = VideoReader(video_path, ctx=cpu(0))
total_frame_num = len(vr)
uniform_sampled_frames = np.linspace(