Update examples/server/server.cpp
Co-authored-by: compilade <git@compilade.net>
This commit is contained in:
parent
a94895217c
commit
8be06dc745
1 changed files with 6 additions and 1 deletions
|
@ -2258,7 +2258,12 @@ struct server_context {
|
||||||
completion_token_output result;
|
completion_token_output result;
|
||||||
const llama_token id = llama_sampling_sample(slot.ctx_sampling, ctx, NULL, slot.i_batch - i);
|
const llama_token id = llama_sampling_sample(slot.ctx_sampling, ctx, NULL, slot.i_batch - i);
|
||||||
if (id == -1) {
|
if (id == -1) {
|
||||||
continue; // keep going, don't crash, already logged
|
send_error(slot, "can't get completions out of an embeddings model");
|
||||||
|
slot.cache_tokens.clear();
|
||||||
|
slot.reset();
|
||||||
|
slot.release();
|
||||||
|
slot.i_batch = -1;
|
||||||
|
continue; // continue loop of slots
|
||||||
}
|
}
|
||||||
|
|
||||||
llama_sampling_accept(slot.ctx_sampling, ctx, id, true);
|
llama_sampling_accept(slot.ctx_sampling, ctx, id, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue