File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -940,6 +940,11 @@ struct common_init_result common_init_from_params(common_params & params) {
940
940
params.sampling .ignore_eos = false ;
941
941
}
942
942
943
+ if (params.sampling .ignore_eos ) {
944
+ LOG_INF (" %s: added EOS logit bias = %f\n " , __func__, -INFINITY);
945
+ params.sampling .logit_bias .push_back ({llama_token_eos (model), -INFINITY});
946
+ }
947
+
943
948
if (params.warmup ) {
944
949
LOG_WRN (" %s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n " , __func__);
945
950
Original file line number Diff line number Diff line change @@ -1467,7 +1467,7 @@ struct server_context {
1467
1467
n_ctx = llama_n_ctx (ctx);
1468
1468
1469
1469
add_bos_token = llama_add_bos_token (model);
1470
- has_eos_token = ! llama_add_eos_token (model);
1470
+ has_eos_token = llama_token_eos (model) != LLAMA_TOKEN_NULL ;
1471
1471
1472
1472
if (!params_base.speculative .model .empty ()) {
1473
1473
SRV_INF (" loading draft model '%s'\n " , params_base.speculative .model .c_str ());
You can’t perform that action at this time.
0 commit comments