* vocab : mark EOT token for Granite models
* sampling : fallback to EOS when EOT is not found
if (n_non_eog == 0) {
cur_p->size = 1;
cur_p->data[0].id = ctx->vocab->token_eot();
+ if (cur_p->data[0].id == LLAMA_TOKEN_NULL) {
+ cur_p->data[0].id = ctx->vocab->token_eos();
+ }
cur_p->data[0].logit = 1.0f;
+ GGML_ASSERT(cur_p->data[0].id != LLAMA_TOKEN_NULL);
+
return;
}
|| t.first == "<|end|>"
|| t.first == "<end_of_turn>"
|| t.first == "<|endoftext|>"
+ || t.first == "<|end_of_text|>" // granite
|| t.first == "<EOT>"
|| t.first == "_<EOT>"
|| t.first == "<|end▁of▁sentence|>" // DeepSeek