Skip to content

Commit fa33614

Browse files
committed
Use llama_ prefix for structs in global namespace.
1 parent 93daad7 commit fa33614

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llama.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4349,7 +4349,7 @@ struct llama_beam {
43494349
};
43504350

43514351
// A struct for calculating logit-related info.
4352-
struct logit_info {
4352+
struct llama_logit_info {
43534353
const float * const logits;
43544354
const int n_vocab;
43554355
const float max_l;
@@ -4358,7 +4358,7 @@ struct logit_info {
43584358
float max_l;
43594359
float operator()(float sum, float l) const { return sum + std::exp(l - max_l); }
43604360
};
4361-
logit_info(llama_context * ctx)
4361+
llama_logit_info(llama_context * ctx)
43624362
: logits(llama_get_logits(ctx))
43634363
, n_vocab(llama_n_vocab(ctx))
43644364
, max_l(*std::max_element(logits, logits + n_vocab))
@@ -4393,7 +4393,7 @@ struct logit_info {
43934393
}
43944394
};
43954395

4396-
struct beam_search {
4396+
struct llama_beam_search_data {
43974397
llama_context * ctx;
43984398
size_t n_beams;
43994399
int n_past;
@@ -4408,7 +4408,7 @@ struct beam_search {
44084408
// Used to communicate to/from callback on beams state.
44094409
std::vector<llama_beam_view> beam_views;
44104410

4411-
beam_search(llama_context * ctx, size_t n_beams, int n_past, int n_predict, int n_threads)
4411+
llama_beam_search_data(llama_context * ctx, size_t n_beams, int n_past, int n_predict, int n_threads)
44124412
: ctx(ctx)
44134413
, n_beams(n_beams)
44144414
, n_past(n_past)
@@ -4452,7 +4452,7 @@ struct beam_search {
44524452
if (!beam.tokens.empty()) {
44534453
llama_eval(ctx, beam.tokens.data(), beam.tokens.size(), n_past, n_threads);
44544454
}
4455-
logit_info logit_info(ctx);
4455+
llama_logit_info logit_info(ctx);
44564456
std::vector<llama_token_data> next_tokens = logit_info.top_k(n_beams);
44574457
size_t i=0;
44584458
if (next_beams.size() < n_beams) {
@@ -4569,9 +4569,9 @@ void llama_beam_search(llama_context * ctx,
45694569
assert(ctx);
45704570
const int64_t t_start_sample_us = ggml_time_us();
45714571

4572-
beam_search beam_search(ctx, n_beams, n_past, n_predict, n_threads);
4572+
llama_beam_search_data beam_search_data(ctx, n_beams, n_past, n_predict, n_threads);
45734573

4574-
beam_search.loop(callback, callback_data);
4574+
beam_search_data.loop(callback, callback_data);
45754575

45764576
ctx->t_sample_us += ggml_time_us() - t_start_sample_us;
45774577
ctx->n_sample++;

0 commit comments

Comments
 (0)