File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments