File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -903,19 +903,16 @@ struct common_init_result common_init_from_params(common_params & params) {
903903 ok = false ;
904904 }
905905
906- if (llama_vocab_eos (vocab) == LLAMA_TOKEN_NULL) {
907- // Now we use SEP as a fallback, so only warn if both are missing
908- if (llama_vocab_sep (vocab) == LLAMA_TOKEN_NULL) {
909- LOG_WRN (" %s: warning: vocab does not have an EOS token or SEP token, reranking will not work\n " ,
910- __func__);
911- ok = false ;
912- } else {
913- LOG_WRN (" %s: warning: vocab does not have an EOS token, using SEP token as fallback\n " , __func__);
914- }
915- }
916-
917- if (llama_vocab_sep (vocab) == LLAMA_TOKEN_NULL) {
918- LOG_WRN (" %s: warning: vocab does not have a SEP token, reranking will not work\n " , __func__);
906+ bool has_eos = llama_vocab_eos (vocab) != LLAMA_TOKEN_NULL;
907+ bool has_sep = llama_vocab_sep (vocab) != LLAMA_TOKEN_NULL;
908+
909+ if (!has_eos && !has_sep) {
910+ LOG_WRN (" %s: warning: vocab does not have an EOS token or SEP token, reranking will not work\n " , __func__);
911+ ok = false ;
912+ } else if (!has_eos) {
913+ LOG_WRN (" %s: warning: vocab does not have an EOS token, using SEP token as fallback\n " , __func__);
914+ } else if (!has_sep) {
915+ LOG_WRN (" %s: warning: vocab does not have a SEP token, reranking will not work\n " , __func__);
919916 ok = false ;
920917 }
921918
You can’t perform that action at this time.
0 commit comments