Skip to content

Commit 9ed430c

Browse files
committed
small fix (2)
1 parent b8000fd commit 9ed430c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tools/server/server.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,18 +3256,16 @@ struct server_context {
32563256

32573257
// entire prompt has been processed
32583258
if (slot.n_past == slot.n_prompt_tokens) {
3259-
// TODO @ngxson : this assertion fails sometimes, why?
3260-
// GGML_ASSERT(slot.cache_tokens.size() == slot.prompt_tokens.size());
3261-
32623259
slot.state = SLOT_STATE_DONE_PROMPT;
32633260

32643261
GGML_ASSERT(batch.n_tokens > 0);
3262+
GGML_ASSERT((size_t) slot.n_prompt_tokens == slot.prompt_tokens.size());
32653263

32663264
common_sampler_reset(slot.smpl);
32673265

32683266
// Process all prompt tokens through sampler system
3269-
for (size_t i = 0; i < slot.cache_tokens.size(); ++i) {
3270-
llama_token id = slot.cache_tokens[i];
3267+
for (int i = 0; i < slot.n_prompt_tokens; ++i) {
3268+
llama_token id = slot.prompt_tokens[i];
32713269
if (id != LLAMA_TOKEN_NULL) {
32723270
common_sampler_accept(slot.smpl, id, false);
32733271
}

0 commit comments

Comments
 (0)