mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5507] [Engine] pack_gguf.py --mmproj: a text-only chat template silently kills vision #5478
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5478
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Astemiir on GitHub (Nov 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5507
[Engine]
pack_gguf.py --mmproj: a text-only chat template silently kills visionArea: Engine / dsv41 packer
Versions: control 0.1.58, app 0.2.12, pack built from a text-only GGUF conversion of
DeepSeek-V4.1-Flash-1017, projector
mmproj-DeepSeek-V4.1-Flash-1017-BF16.gguf(0.97 GB).Problem
tools/dsv41/pack_gguf.pytakestokenizer.chat_templatefrom the source GGUF as is(
kv.get("tokenizer.chat_template"), only a hard failure when it is missing). When the sourceGGUF is a text-only conversion, its template renders
message['content']as a Pythonstring, so a content list (text + image parts) is serialised as its
reprand the marker<|deepseek_image|>never appears in the prompt.The pack then looks healthy:
--pack-infoprintsvision 0.97,files: N, all present and long enough;/healthreportsimages: true(the server buildsDsPicturesfromimage_token_id+vision geometry);
but at request time
DsPictures.build()finds zero image markers in the ids and thepicture is dropped/refused — the tower is loaded and never used. Nothing in the log points at
the template.
We hit this while adding the tower to a pack built from a text-only conversion; the fix was to
teach the template to emit the marker for
type == "image"parts (render_partsmacro), afterwhich the same pack answered correctly (640×360 picture,
prompt_tokens 207including 182 imagetokens).
Suggested fix
When
pack_gguf.pypacks vision (--mmproj, or a tower found beside the model) and setsimage_token_id, verify the template:if IMAGE_TOKEN not in template:— either fail with a clear message("the source GGUF has a text-only chat template; vision would be dead — pass a vision-aware
chat_template.jinjaor patch it"), or apply the minimal injection (parttype:image→<|deepseek_image|>, parttype:text→ its text) the way the HFpatch_chat_template.pydoes for older downloads.
refuses (or patches) it, in the spirit of
serve/test_vision_token_limit.py.Why it matters
The failure mode is silent for the user: every indicator says pictures are on, and only the
answer reveals that the model never saw the image. A one-line check in the packer removes a
whole class of "vision does not work on my pack" reports.
The tower is model-wide
The same 5120-wide projector serves every build of V4.1-Flash-1017 (ISTA-DASLab IQ1_M / IQ2_XXS /
IQ2_XS, Unsloth UD-Q8_K_XL, any GGUF conversion), so a pack built from any of those quants can get
vision this way. Working example with the file, the attach tool and the measurements:
https://github.com/Astemiir/strata-deepseek-v41-vision (MIT).
A side note on the default set
Not part of the bug and nothing to patch: the numbers in
docs/DEEPSEEK41.mdmake 2.25 bpw the better defaultwherever the disk and RAM allow it. On disk it is 17 GB more (155 + 111 + 8 = 274 GB against
138 + 111 + 8 = 257 GB) and 4 GB more RAM (
ram_gb44 against 40 insetup.py), while quality is+7.3% perplexity, +3.2% code and +2.2% agent work, against +15.5%, +8.6% and +5.3% for 2.00. Speed
does not separate them:
setup.pyalready says "about the same speed" for 2.25, anddocs/DEEPSEEK41.md measures four R9700 at 48 t/s on 2.00 and 80 on 2.25 (code, shipped profiles).
2.00 remains the right pick for a 12 GB card with 40 GB of RAM - it reads as the default for the
tight boxes, while 2.25 is the one a 24 GB / 128 GB PC would want to be offered by name.
Reporter context: reproduced on Windows 11, RTX 3090,
strata-dsv410.1.58, on the ISTA-DASLab 2.25 bpw (IQ2_XS) set, the largest of the three official ones (274 GB of disk against 257 GB for 2.00). The same projector serves the 1.75 and 2.00 sets too.@github-actions[bot] commented on GitHub (Nov 7, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Nov 7, 2026):
Thanks, this follows the format now.