Skip to content

Commit 1353a81

Browse files
ggerganovarthw
authored andcommitted
llama : fix build + fix fabs compile warnings (ggml-org#8683)
ggml-ci
1 parent 21905dd commit 1353a81

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/llama-grammar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ struct llama_grammar {
1313
llama_partial_utf8 partial_utf8;
1414
};
1515

16-
struct llama_grammar * llama_get_grammar(struct llama_context * ctx);
17-
1816
//
1917
// internal API
2018
//

src/llama.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,7 +2657,6 @@ struct llama_context {
26572657
llama_context(const llama_model & model)
26582658
: model(model)
26592659
, sampling(llama_n_vocab(&model))
2660-
, grammar()
26612660
, t_start_us(model.t_start_us)
26622661
, t_load_us(model.t_load_us) {}
26632662

@@ -2675,7 +2674,6 @@ struct llama_context {
26752674

26762675
struct llama_cparams cparams;
26772676
struct llama_sampling sampling;
2678-
struct llama_grammar grammar;
26792677
struct llama_kv_cache kv_self;
26802678
struct llama_control_vector cvec;
26812679

@@ -14049,7 +14047,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
1404914047
f = -INFINITY;
1405014048
} else {
1405114049
if (hparams.use_alibi) {
14052-
f = -fabs(lctx.kv_self.cells[i].pos - pos);
14050+
f = -std::abs(lctx.kv_self.cells[i].pos - pos);
1405314051
} else {
1405414052
f = 0.0f;
1405514053
}
@@ -14103,7 +14101,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
1410314101
for (int s = 0; s < batch.n_seq_id[i]; ++s) {
1410414102
if (batch.seq_id[i][s] == seq_id) {
1410514103
if (hparams.use_alibi) {
14106-
f = -fabs(batch.pos[i] - batch.pos[j]);
14104+
f = -std::abs(batch.pos[i] - batch.pos[j]);
1410714105
} else {
1410814106
f = 0.0f;
1410914107
}
@@ -16835,10 +16833,6 @@ const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx) {
1683516833
return &ctx->model.vocab;
1683616834
}
1683716835

16838-
struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
16839-
return &ctx->grammar;
16840-
}
16841-
1684216836
uint32_t llama_n_ctx(const struct llama_context * ctx) {
1684316837
return ctx->cparams.n_ctx;
1684416838
}

0 commit comments

Comments
 (0)