]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : add llama_n_head() (#9512)
authorMichael Podvitskiy <redacted>
Tue, 17 Sep 2024 06:23:30 +0000 (08:23 +0200)
committerGitHub <redacted>
Tue, 17 Sep 2024 06:23:30 +0000 (09:23 +0300)
include/llama.h
src/llama.cpp

index cfc8d85dc0474f2f4b5501f6a9a868a781c7f7b8..f316a87ba31509e9738ff63d206cc2b6ebd41fb2 100644 (file)
@@ -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);
 
index 0da764f9d118638bae148a415c5f3759e8a6fbc6..146b327d0c3e2398bc63fd8cb51026c3f8004ec4 100644 (file)
@@ -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;
 }