common: warmup: Handle situation when eos=bos=-1
Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
This commit is contained in:
parent
bdf314f38a
commit
295e9945f9
1 changed files with 6 additions and 1 deletions
|
@ -2531,7 +2531,12 @@ struct llama_init_result llama_init_from_gpt_params(gpt_params & params) {
|
||||||
if (bos != -1) {
|
if (bos != -1) {
|
||||||
tmp.push_back(bos);
|
tmp.push_back(bos);
|
||||||
}
|
}
|
||||||
tmp.push_back(eos);
|
if (eos != -1) {
|
||||||
|
tmp.push_back(eos);
|
||||||
|
}
|
||||||
|
if (tmp.empty()) {
|
||||||
|
tmp.push_back(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (llama_model_has_encoder(model)) {
|
if (llama_model_has_encoder(model)) {
|
||||||
llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size(), 0, 0));
|
llama_encode(lctx, llama_batch_get_one(tmp.data(), tmp.size(), 0, 0));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue