mirror of https://github.com/google/gemma.cpp.git
Fix paligemma: must subtract image tokens from prompt length
PiperOrigin-RevId: 865905454
This commit is contained in:
parent
60eed010ba
commit
2751a194be
|
|
@ -200,7 +200,7 @@ void ReplGemma(const GemmaArgs& args, const Gemma& gemma, KVCache& kv_cache,
|
|||
config.wrapping, abs_pos, prompt_string,
|
||||
image_tokens.Rows());
|
||||
runtime_config.image_tokens = &image_tokens;
|
||||
prompt_size = prompt.size();
|
||||
prompt_size = prompt.size() - image_tokens.Rows();
|
||||
if (config.wrapping == PromptWrapping::PALIGEMMA) {
|
||||
// The end of the prefix for prefix-LM style attention in Paligemma.
|
||||
// See Figure 2 of https://arxiv.org/abs/2407.07726.
|
||||
|
|
|
|||
Loading…
Reference in New Issue