From b8acf16e730507d7ff6a4676e64765be38154488 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Fri, 5 Jun 2026 01:40:08 +0800 Subject: [PATCH] hacky fix that worked for gemma4 uv --- gpttype_adapter.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index 7b94b6089..d86176125 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -4807,7 +4807,16 @@ generation_outputs gpttype_generate(const generation_inputs inputs) std::vector media_intro; //added before media list std::vector media_outro; //added before media list - TokenizeString("\nAttached Media:\n", media_intro, file_format, true); + std::string intro = "\nAttached Media:\n"; + if(clp_ctx_v) //ugly fix for gemma4uv vision coherency + { + int ptype = clip_get_projector_type_ext(clp_ctx_v); + if(ptype==PROJECTOR_TYPE_GEMMA4UV) + { + intro = "\n<|channel>" + intro; + } + } + TokenizeString(intro, media_intro, file_format, true); //clear previous run llava embd memory, just-in-time free for(int i=0;i