Skip to content

Commit

Permalink
squash! llama : add getters for n_threads/n_threads_batch
Browse files Browse the repository at this point in the history
Rename the getters to llama_n_threads and llama_n_threads_batch.

Signed-off-by: Daniel Bevenius <[email protected]>
  • Loading branch information
danbev committed May 22, 2024
1 parent e4aff81 commit 12ff284
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17197,11 +17197,11 @@ void llama_set_n_threads(struct llama_context * ctx, uint32_t n_threads, uint32_
ctx->cparams.n_threads_batch = n_threads_batch;
}

uint32_t llama_get_n_threads(struct llama_context * ctx) {
uint32_t llama_n_threads(struct llama_context * ctx) {
return ctx->cparams.n_threads;
}

uint32_t llama_get_n_threads_batch(struct llama_context * ctx) {
uint32_t llama_n_threads_batch(struct llama_context * ctx) {
return ctx->cparams.n_threads_batch;
}

Expand Down
4 changes: 2 additions & 2 deletions llama.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,10 @@ extern "C" {
LLAMA_API void llama_set_n_threads(struct llama_context * ctx, uint32_t n_threads, uint32_t n_threads_batch);

// Get the number of threads used for generation of a single token.
LLAMA_API uint32_t llama_get_n_threads(struct llama_context * ctx);
LLAMA_API uint32_t llama_n_threads(struct llama_context * ctx);

// Get the number of threads used for prompt and batch processing (multiple token).
LLAMA_API uint32_t llama_get_n_threads_batch(struct llama_context * ctx);
LLAMA_API uint32_t llama_n_threads_batch(struct llama_context * ctx);

// Set whether to use causal attention or not
// If set to true, the model will only attend to the past tokens
Expand Down

0 comments on commit 12ff284

Please sign in to comment.