Michael Podvitskiy 1 год назад
Родитель
Сommit
37f3a3810e
2 измененных файлов с 5 добавлено и 0 удалено
  1. 1 0
      include/llama.h
  2. 4 0
      src/llama.cpp

+ 1 - 0
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);
 

+ 4 - 0
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;
 }