Unverified Commit 04a9e064 authored by JJJYmmm's avatar JJJYmmm Committed by GitHub
Browse files

[Bugfix] fix the ima issue of qwen-vit (#32687)


Signed-off-by: default avatarJJJYmmm <92386084+JJJYmmm@users.noreply.github.com>
parent c025263d
...@@ -384,6 +384,7 @@ class Qwen2_5_VisionAttention(nn.Module): ...@@ -384,6 +384,7 @@ class Qwen2_5_VisionAttention(nn.Module):
qk_reshaped = einops.rearrange( qk_reshaped = einops.rearrange(
qk, "b s two head head_dim -> (two b) s head head_dim", two=2 qk, "b s two head head_dim -> (two b) s head head_dim", two=2
) )
qk_reshaped = qk_reshaped.contiguous()
qk_rotated = self.apply_rotary_emb( qk_rotated = self.apply_rotary_emb(
qk_reshaped, qk_reshaped,
rotary_pos_emb_cos, rotary_pos_emb_cos,
......
...@@ -128,8 +128,8 @@ from .vision import ( ...@@ -128,8 +128,8 @@ from .vision import (
logger = init_logger(__name__) logger = init_logger(__name__)
# Official recommended max pixels is 24576 * 32 * 32 # Official recommended max frames is 2048
_MAX_FRAMES_PER_VIDEO = 24576 _MAX_FRAMES_PER_VIDEO = 2048
class Qwen3_VisionPatchEmbed(nn.Module): class Qwen3_VisionPatchEmbed(nn.Module):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment