fix minicpmo4.5: fix attn_mask in vit attn && fix resampler pos_emb i… (#34127)

Signed-off-by: tc-mb <caitianchi@modelbest.cn>
Co-authored-by: hezhihui <hezhihui@modelbest.cn>
This commit is contained in:
tc-mb
2026-03-04 17:46:17 +00:00
committed by GitHub
co-authored by hezhihui
parent d25c1ec3c9
commit bfdb512f11
2 changed files with 69 additions and 7 deletions
+2 -2
View File
@@ -387,8 +387,8 @@ class Resampler4_5(Resampler2_5):
pos_embed_2d, batch_first=True, padding_value=0.0
).permute(1, 0, 2) # BLD => L * B * D
k = x
v = x + pos_embed_2d
k = x + pos_embed_2d
v = x
if pos_embed_temporal:
k += torch.stack(pos_embed_temporal, dim=0)
bs = len(temporal_ids)