server : fix cache_tokens bug with no cache_prompt (#13533)

This commit is contained in:
Xuan-Son Nguyen 2025-05-14 13:35:07 +02:00 committed by GitHub
parent 09d13d94fb
commit 360a9c98e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 11 deletions

View file

@ -1153,7 +1153,7 @@ public:
tokens.clear();
}
void resize(size_t n) {
void keep_first(size_t n) {
GGML_ASSERT(n <= tokens.size());
if (has_mtmd) {
// we throw an error if we try to remove a token in the middle of an image