Repository navigation
server : fix server_tokens::push_back infinite loop and placeholder copy - #29956
sanjeevafk wants to merge 1 commit into
Conversation
|
Hi @sanjeevafk, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
a1ef2c6 to
1763b07
Compare
|
Updated the PR description and commit message to match the template and project guidelines. |
|
Hi, the keep_first fix is already covered by #24076, open since June |
…nsertion - Copy tokens in bulk via vector::insert instead of calling single-token push_back, which threw an error on LLAMA_TOKEN_NULL media placeholders - Increment the media map iterator (++it) to fix the infinite loop - Accept const server_tokens & and use it->second.get() directly Fixes ggml-org#29865
1763b07 to
ea0eae2
Compare
|
@ServeurpersoCom Thanks for catching that! I didn't realize #24076 had already addressed the I've reverted the |
|
Note that on master this path is only reached by format_prompt_rerank with text-only tokens, so this is a latent fix with no reachable repro today. |
|
Ok then, I will leave it up to the maintainers whether to merge it proactively or wait till the multimodal rerank expands. Thanks for the catch. |
Overview
Fixes #29865 in
server_tokens::push_back(const server_tokens & tokens):this->tokens.insert(...)rather than calling the single-token overloadpush_back(tokens[i]), which throws an error onLLAMA_TOKEN_NULLplaceholders.++itin the media map loop to fix an infinite loop when copying media chunks.constreference and useit->second.get().Note: Dropped the
keep_firstchange from this PR to avoid overlap with #24076.Additional information
Tested locally appending server tokens with media chunks; confirmed the loop terminates properly and placeholders copy without throwing.
Requirements