Skip to content

Commit

Permalink
llama : fix build + fix fabs compile warnings (#8683)
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov authored Jul 25, 2024
1 parent bf5a81d commit 4226a8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/llama-grammar.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ struct llama_grammar {
llama_partial_utf8 partial_utf8;
};

struct llama_grammar * llama_get_grammar(struct llama_context * ctx);

//
// internal API
//
Expand Down
10 changes: 2 additions & 8 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,6 @@ struct llama_context {
llama_context(const llama_model & model)
: model(model)
, sampling(llama_n_vocab(&model))
, grammar()
, t_start_us(model.t_start_us)
, t_load_us(model.t_load_us) {}

Expand All @@ -2675,7 +2674,6 @@ struct llama_context {

struct llama_cparams cparams;
struct llama_sampling sampling;
struct llama_grammar grammar;
struct llama_kv_cache kv_self;
struct llama_control_vector cvec;

Expand Down Expand Up @@ -14048,7 +14046,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
f = -INFINITY;
} else {
if (hparams.use_alibi) {
f = -fabs(lctx.kv_self.cells[i].pos - pos);
f = -std::abs(lctx.kv_self.cells[i].pos - pos);
} else {
f = 0.0f;
}
Expand Down Expand Up @@ -14102,7 +14100,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
for (int s = 0; s < batch.n_seq_id[i]; ++s) {
if (batch.seq_id[i][s] == seq_id) {
if (hparams.use_alibi) {
f = -fabs(batch.pos[i] - batch.pos[j]);
f = -std::abs(batch.pos[i] - batch.pos[j]);
} else {
f = 0.0f;
}
Expand Down Expand Up @@ -16833,10 +16831,6 @@ const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx) {
return &ctx->model.vocab;
}

struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
return &ctx->grammar;
}

uint32_t llama_n_ctx(const struct llama_context * ctx) {
return ctx->cparams.n_ctx;
}
Expand Down

0 comments on commit 4226a8d

Please sign in to comment.