llama: the method for obtaining information about n_head is included in the public header

This commit is contained in:
Michael Podvitskiy 2024-09-16 19:16:49 +02:00
parent 23e0d70bac
commit 546524de6c
2 changed files with 5 additions and 0 deletions

View 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_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_embd (const struct llama_model * model);
LLAMA_API int32_t llama_n_layer (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); LLAMA_API const struct llama_model * llama_get_model(const struct llama_context * ctx);

View file

@ -19047,6 +19047,10 @@ int32_t llama_n_layer(const struct llama_model * model) {
return model->hparams.n_layer; 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) { const struct llama_model * llama_get_model(const struct llama_context * ctx) {
return &ctx->model; return &ctx->model;
} }