From: Michael Podvitskiy Date: Tue, 17 Sep 2024 06:23:30 +0000 (+0200) Subject: llama : add llama_n_head() (#9512) X-Git-Tag: upstream/0.0.4488~714 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=37f3a3810e545be6ac835c726f97956c1403ea02;p=pkg%2Fggml%2Fsources%2Fllama.cpp llama : add llama_n_head() (#9512) --- diff --git a/include/llama.h b/include/llama.h index cfc8d85d..f316a87b 100644 --- a/include/llama.h +++ b/include/llama.h @@ -441,6 +441,7 @@ extern "C" { LLAMA_API int32_t llama_n_ctx_train(const struct llama_model * model); LLAMA_API int32_t llama_n_embd (const struct llama_model * model); LLAMA_API int32_t llama_n_layer (const struct llama_model * model); + LLAMA_API int32_t llama_n_head (const struct llama_model * model); LLAMA_API const struct llama_model * llama_get_model(const struct llama_context * ctx); diff --git a/src/llama.cpp b/src/llama.cpp index 0da764f9..146b327d 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -19047,6 +19047,10 @@ int32_t llama_n_layer(const struct llama_model * model) { return model->hparams.n_layer; } +int32_t llama_n_head(const struct llama_model * model) { + return model->hparams.n_head(); +} + const struct llama_model * llama_get_model(const struct llama_context * ctx) { return &ctx->model; }