@@ -2657,7 +2657,6 @@ struct llama_context {
2657
2657
llama_context(const llama_model & model)
2658
2658
: model(model)
2659
2659
, sampling(llama_n_vocab(&model))
2660
- , grammar()
2661
2660
, t_start_us(model.t_start_us)
2662
2661
, t_load_us(model.t_load_us) {}
2663
2662
@@ -2675,7 +2674,6 @@ struct llama_context {
2675
2674
2676
2675
struct llama_cparams cparams;
2677
2676
struct llama_sampling sampling;
2678
- struct llama_grammar grammar;
2679
2677
struct llama_kv_cache kv_self;
2680
2678
struct llama_control_vector cvec;
2681
2679
@@ -14048,7 +14046,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
14048
14046
f = -INFINITY;
14049
14047
} else {
14050
14048
if (hparams.use_alibi) {
14051
- f = -fabs (lctx.kv_self.cells[i].pos - pos);
14049
+ f = -std::abs (lctx.kv_self.cells[i].pos - pos);
14052
14050
} else {
14053
14051
f = 0.0f;
14054
14052
}
@@ -14102,7 +14100,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
14102
14100
for (int s = 0; s < batch.n_seq_id[i]; ++s) {
14103
14101
if (batch.seq_id[i][s] == seq_id) {
14104
14102
if (hparams.use_alibi) {
14105
- f = -fabs (batch.pos[i] - batch.pos[j]);
14103
+ f = -std::abs (batch.pos[i] - batch.pos[j]);
14106
14104
} else {
14107
14105
f = 0.0f;
14108
14106
}
@@ -16833,10 +16831,6 @@ const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx) {
16833
16831
return &ctx->model.vocab;
16834
16832
}
16835
16833
16836
- struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
16837
- return &ctx->grammar;
16838
- }
16839
-
16840
16834
uint32_t llama_n_ctx(const struct llama_context * ctx) {
16841
16835
return ctx->cparams.n_ctx;
16842
16836
}
0 commit comments