Skip to content

Commit 5114672

Browse files
authored
fix: detect vision patch size for unsplit (HF-format) Qwen3-VL (#1811)
1 parent 8a51eb9 commit 5114672

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/model/te/llm.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ namespace LLM {
200200
config.vision.in_channels = tensor_storage.ne[2];
201201
config.vision.hidden_size = tensor_storage.ne[3];
202202
}
203-
if (contains(name, "visual.patch_embed.bias")) {
203+
// HF-format checkpoints keep the patch embed unsplit under a single name.
204+
if (contains(name, "visual.patch_embed.proj.weight")) {
205+
config.vision.patch_size = static_cast<int>(tensor_storage.ne[0]);
206+
}
207+
if (contains(name, "visual.patch_embed.bias") || contains(name, "visual.patch_embed.proj.bias")) {
204208
config.vision.hidden_size = tensor_storage.ne[0];
205209
}
206210
if (contains(name, "visual.pos_embed.weight")) {

0 commit comments

Comments
 (0)