mtmd: use causal attn for gemma 4 audio (#21824)

This commit is contained in:
Xuan-Son Nguyen authored and GitHub committed 2026-04-13 09:47:55 +02:00
1 parent 974c8c94cc
commit 920b3e78cb
3 files changed
+11 -5

No files matched your search

+6 -2
View File
@@ -1017,8 +1017,12 @@ float * mtmd_get_output_embd(mtmd_context * ctx) {
return ctx->image_embd_v.data();
}
bool mtmd_decode_use_non_causal(mtmd_context * ctx) {
switch (ctx->proj_type_v()) {
bool mtmd_decode_use_non_causal(mtmd_context * ctx, const mtmd_input_chunk * chunk) {
auto proj_type = ctx->proj_type_v();
if (chunk && chunk->type == MTMD_INPUT_CHUNK_TYPE_AUDIO) {
proj_type = ctx->proj_type_a();
}
switch (proj_type) {
case PROJECTOR_TYPE_GEMMA3:
case PROJECTOR_TYPE_GEMMA4V:
return true;