Skip to content

Commit 981d578

Browse files
authored
Remove embd hack from qwen3vl.cpp
1 parent b85cddb commit 981d578

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/models/qwen3vl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
llm_build_qwen3vl::llm_build_qwen3vl(const llama_model & model, const llm_graph_params & params) : llm_graph_context(params) {
44

5-
const int64_t n_embd_full = hparams.n_embd; // main embd + deepstack embds
65
const size_t n_deepstack_layers = hparams.n_deepstack_layers;
7-
const int64_t n_embd = n_embd_full / (n_deepstack_layers + 1);
6+
const int64_t n_embd_full = hparams.n_embd * (n_deepstack_layers + 1); // main embd + deepstack embds
7+
const int64_t n_embd = hparams.n_embd;
88
const int64_t n_embd_head = hparams.n_embd_head_v;
99

1010

@@ -23,9 +23,9 @@ llm_build_qwen3vl::llm_build_qwen3vl(const llama_model & model, const llm_graph_
2323

2424
if (ubatch.embd) {
2525
// Image input: split main embd and deepstack embds
26-
ggml_tensor * inpL_main = ggml_view_2d(ctx0, inpL, n_embd, n_tokens, inpL->nb[1], 0);
26+
ggml_tensor * inpL_main = ggml_view_2d(ctx0, inpL, n_embd_full, n_tokens, inpL->nb[1], 0);
2727
for (size_t i = 0; i < n_deepstack_layers; i++) {
28-
deepstack_features[i] = ggml_view_2d(ctx0, inpL, n_embd, n_tokens, inpL->nb[1], (i + 1) * n_embd * sizeof(float));
28+
deepstack_features[i] = ggml_view_2d(ctx0, inpL, n_embd_full, n_tokens, inpL->nb[1], (i + 1) * n_embd * sizeof(float));
2929
}
3030
inpL = inpL_main;
3131
}

0 commit comments

Comments
 (0)