Skip to content

Commit 4226a8d

Browse files
authored
llama : fix build + fix fabs compile warnings (#8683)
ggml-ci
1 parent bf5a81d commit 4226a8d

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

@@ -14048,7 +14046,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
1404814046
f = -INFINITY;
1404914047
} else {
1405014048
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);
1405214050
} else {
1405314051
f = 0.0f;
1405414052
}
@@ -14102,7 +14100,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
1410214100
for (int s = 0; s < batch.n_seq_id[i]; ++s) {
1410314101
if (batch.seq_id[i][s] == seq_id) {
1410414102
if (hparams.use_alibi) {
14105-
f = -fabs(batch.pos[i] - batch.pos[j]);
14103+
f = -std::abs(batch.pos[i] - batch.pos[j]);
1410614104
} else {
1410714105
f = 0.0f;
1410814106
}
@@ -16833,10 +16831,6 @@ const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx) {
1683316831
return &ctx->model.vocab;
1683416832
}
1683516833

16836-
struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
16837-
return &ctx->grammar;
16838-
}
16839-
1684016834
uint32_t llama_n_ctx(const struct llama_context * ctx) {
1684116835
return ctx->cparams.n_ctx;
1684216836
}

0 commit comments

Comments
 (0)