recover main.cpp

This commit is contained in:
zhangkaihuo 2024-04-11 15:48:59 +08:00
parent 582b13c966
commit 4f61b3066e

View file

@ -795,9 +795,7 @@ int main(int argc, char ** argv) {
} }
// deal with end of text token in interactive mode // deal with end of text token in interactive mode
auto last_token = llama_sampling_last(ctx_sampling); if (llama_sampling_last(ctx_sampling) == llama_token_eos(model)) {
if (last_token == llama_token_eos(model))
{
LOG("found EOS token\n"); LOG("found EOS token\n");
if (params.interactive) { if (params.interactive) {
@ -922,7 +920,7 @@ int main(int argc, char ** argv) {
} }
// end of text token // end of text token
if (!embd.empty() && (embd.back() == llama_token_eos(model)) && !(params.instruct || params.interactive || params.chatml)) { if (!embd.empty() && embd.back() == llama_token_eos(model) && !(params.instruct || params.interactive || params.chatml)) {
LOG_TEE(" [end of text]\n"); LOG_TEE(" [end of text]\n");
break; break;
} }