Files
ds4/tests/test_qwen4_vision.c
T
ccea768827 Add Qwen3.8 Flash Next model support
Implement qwen4exp loading, tokenizer and chat formatting, PLE sidecars,
Metal text and vision graphs, built-in MTP, and recurrent KV persistence.
Integrate the CLI, agent, server, download targets, and conversion tools.

Preserve the native Q4_1 encoder, Q4_K accumulation guard, and shared
quantizer build target. Keep exact-MTP rewind and vision-cache row-width
fixes. Persist valid logits and recurrent state at completed prefill chunks,
and reuse Qwen text-answer history when tools clients omit reasoning.
Retain exact reasoning replay and test continued checkpoints, cancellation,
cache eviction, and restart reuse with and without reasoning_content. Include
reproducible charts and measurements comparing throughput before and after
the checkpoint fixes on M3 Ultra.

Add Qwen trunk steering and prompt activation capture, including GDN layers.
Keep the MTP predictor outside the 48-row bank and preserve prompt dumps
through one-token prefill tails and multi-row speculative verification.
Recover Chrome target creation and retain its last page target. Preserve
full agent transcripts in stripped-session format when KV no longer fits,
while retaining the newer automatic compaction and continuation logic.
Add steering/MTP/capture, Chrome CDP recovery, and full-session save/reload
regressions. Adapt the intended changes from fork PRs #13 and #7.

Reconcile with antirez main bd66c40, preserving DeepSeek v4.1 model IDs,
tool syntax, session state, and Metal kernel dispatch. Exclude superseded
engine code and prototypes.

Co-authored-by: Andreas Parusel <aparuael@7170c824-6152-4cf1-985e-9503832ce673.fritz.box>
Co-authored-by: david <contact@davidberard.fr>
Co-authored-by: Michael Kuebbeler <cropduster@users.noreply.github.com>
Co-authored-by: Ogilthorp3 <bertrand@nepveu.name>
Co-authored-by: anemll <realanemll@gmail.com>
2026-09-13 14:57:29 +02:00

21 lines
882 B
C

/* Dump the Qwen3.8 vision tower output for one image; tests/qwen4_vision_ref.py
* compares it against the HF vision model */
#include "ds4.h"
#include <stdio.h>
#include <stdlib.h>
/* ds4.c: writes u32 tokens, dim, grid rows, grid cols, then the merged embeddings as floats */
int ds4_qwen4_vision_dump(const char *vision_path, const char *image_path, const char *out_path,
uint32_t min_image_tokens, uint32_t max_image_tokens);
int main(int argc, char **argv) {
if (argc < 4) {
fprintf(stderr, "usage: %s mmproj.gguf image out.bin [min_tokens max_tokens]\n", argv[0]);
return 2;
}
const uint32_t min_tokens = argc > 4 ? (uint32_t)atoi(argv[4]) : 64u;
const uint32_t max_tokens = argc > 5 ? (uint32_t)atoi(argv[5]) : 1024u;
return ds4_qwen4_vision_dump(argv[1], argv[2], argv[3], min_tokens, max_tokens) ? 0 : 1;
}