server : fix 'terminated by signal SIGSEGV' error when suffix is empty
This commit is contained in:
parent
22c69a2794
commit
73cab75f41
1 changed files with 1 additions and 1 deletions
|
@ -349,7 +349,7 @@ struct llama_server_context
|
|||
auto prefix_tokens = tokenize(params.input_prefix, false);
|
||||
auto suffix_tokens = tokenize(params.input_suffix, false);
|
||||
const int space_token = 29871;
|
||||
if (suff_rm_leading_spc && suffix_tokens[0] == space_token) {
|
||||
if (suff_rm_leading_spc && !suffix_tokens.empty() && suffix_tokens[0] == space_token) {
|
||||
suffix_tokens.erase(suffix_tokens.begin());
|
||||
}
|
||||
prefix_tokens.insert(prefix_tokens.begin(), llama_token_prefix(ctx));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue