From 3b5f7c2a9b13a40233b79753de60000ae1c95fa3 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 28 Aug 2024 21:56:53 -0700 Subject: [PATCH] fix two more public APIs to use int32_t for n_threads --- include/llama.h | 4 ++-- src/llama.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llama.h b/include/llama.h index 3c7f89fe0..c3bda9e02 100644 --- a/include/llama.h +++ b/include/llama.h @@ -847,10 +847,10 @@ extern "C" { LLAMA_API void llama_set_n_threads(struct llama_context * ctx, int32_t n_threads, int32_t n_threads_batch); // Get the number of threads used for generation of a single token. - LLAMA_API int llama_n_threads(struct llama_context * ctx); + LLAMA_API int32_t llama_n_threads(struct llama_context * ctx); // Get the number of threads used for prompt and batch processing (multiple token). - LLAMA_API int llama_n_threads_batch(struct llama_context * ctx); + LLAMA_API int32_t llama_n_threads_batch(struct llama_context * ctx); // Set whether the model is in embeddings mode or not // If true, embeddings will be returned but logits will not diff --git a/src/llama.cpp b/src/llama.cpp index fb5b76ebf..2274296b4 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -19394,11 +19394,11 @@ void llama_set_n_threads(struct llama_context * ctx, int32_t n_threads, int32_t ctx->cparams.n_threads_batch = n_threads_batch; } -int llama_n_threads(struct llama_context * ctx) { +int32_t llama_n_threads(struct llama_context * ctx) { return ctx->cparams.n_threads; } -int llama_n_threads_batch(struct llama_context * ctx) { +int32_t llama_n_threads_batch(struct llama_context * ctx) { return ctx->cparams.n_threads_batch; }