summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llama.cpp6
-rw-r--r--llama.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/llama.cpp b/llama.cpp
index 90d860eb..63ebe581 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -9532,10 +9532,14 @@ const llama_model * llama_get_model(const struct llama_context * ctx) {
return &ctx->model;
}
-int llama_n_ctx(const struct llama_context * ctx) {
+uint32_t llama_n_ctx(const struct llama_context * ctx) {
return ctx->cparams.n_ctx;
}
+uint32_t llama_n_batch(const struct llama_context * ctx) {
+ return ctx->cparams.n_batch;
+}
+
enum llama_vocab_type llama_vocab_type(const struct llama_model * model) {
return model->vocab.type;
}
diff --git a/llama.h b/llama.h
index 15ab4f80..0be4b133 100644
--- a/llama.h
+++ b/llama.h
@@ -314,7 +314,9 @@ extern "C" {
LLAMA_API const struct llama_model * llama_get_model(const struct llama_context * ctx);
- LLAMA_API int llama_n_ctx (const struct llama_context * ctx);
+ // TODO: become more consistent with returned int types across the API
+ LLAMA_API uint32_t llama_n_ctx (const struct llama_context * ctx);
+ LLAMA_API uint32_t llama_n_batch (const struct llama_context * ctx);
LLAMA_API enum llama_vocab_type llama_vocab_type(const struct llama_model * model);