Update gptneox-main.cpp

This commit is contained in:
klosax 2023-08-01 14:44:28 +02:00 committed by GitHub
parent c77fabb1f9
commit 36a36c32a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -716,6 +716,9 @@ int main(int argc, char ** argv) {
}
uint32_t eos_token_id = 0;
int keyidx = gguf_find_key(ggufctx, "tokenizer.ggml.eos_token_id"); if( keyidx != -1 ) { eos_token_id = gguf_get_val_u32(ggufctx, keyidx); }
int n_past = 0;
int64_t t_sample_us = 0;
@ -794,7 +797,7 @@ int main(int argc, char ** argv) {
fflush(stdout);
// end of text token
if (embd.back() == 0) {
if (embd.back() == eos_token_id) {
break;
}
}