add API functions to access remaining model parameters:
mult, head and rot
This commit is contained in:
parent
9eb1ef8653
commit
c0a372fd3d
2 changed files with 30 additions and 0 deletions
24
llama.cpp
24
llama.cpp
|
@ -4147,6 +4147,18 @@ int llama_n_embd_from_model(const struct llama_model * model) {
|
||||||
return model->hparams.n_embd;
|
return model->hparams.n_embd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int llama_n_mult_from_model(const struct llama_model * model) {
|
||||||
|
return model->hparams.n_mult;
|
||||||
|
}
|
||||||
|
|
||||||
|
int llama_n_head_from_model(const struct llama_model * model) {
|
||||||
|
return model->hparams.n_head;
|
||||||
|
}
|
||||||
|
|
||||||
|
int llama_n_rot_from_model(const struct llama_model * model) {
|
||||||
|
return model->hparams.n_rot;
|
||||||
|
}
|
||||||
|
|
||||||
int llama_n_layer_from_model(const struct llama_model * model) {
|
int llama_n_layer_from_model(const struct llama_model * model) {
|
||||||
return model->hparams.n_layer;
|
return model->hparams.n_layer;
|
||||||
}
|
}
|
||||||
|
@ -4163,6 +4175,18 @@ int llama_n_embd(const struct llama_context * ctx) {
|
||||||
return ctx->model.hparams.n_embd;
|
return ctx->model.hparams.n_embd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int llama_n_mult(const struct llama_context * ctx) {
|
||||||
|
return ctx->model.hparams.n_mult;
|
||||||
|
}
|
||||||
|
|
||||||
|
int llama_n_head(const struct llama_context * ctx) {
|
||||||
|
return ctx->model.hparams.n_head;
|
||||||
|
}
|
||||||
|
|
||||||
|
int llama_n_rot(const struct llama_context * ctx) {
|
||||||
|
return ctx->model.hparams.n_rot;
|
||||||
|
}
|
||||||
|
|
||||||
int llama_n_layer(const struct llama_context * ctx) {
|
int llama_n_layer(const struct llama_context * ctx) {
|
||||||
return ctx->model.hparams.n_layer;
|
return ctx->model.hparams.n_layer;
|
||||||
}
|
}
|
||||||
|
|
6
llama.h
6
llama.h
|
@ -330,11 +330,17 @@ extern "C" {
|
||||||
LLAMA_API int llama_n_vocab(const struct llama_context * ctx);
|
LLAMA_API int llama_n_vocab(const struct llama_context * ctx);
|
||||||
LLAMA_API int llama_n_ctx (const struct llama_context * ctx);
|
LLAMA_API int llama_n_ctx (const struct llama_context * ctx);
|
||||||
LLAMA_API int llama_n_embd (const struct llama_context * ctx);
|
LLAMA_API int llama_n_embd (const struct llama_context * ctx);
|
||||||
|
LLAMA_API int llama_n_mult (const struct llama_context * ctx);
|
||||||
|
LLAMA_API int llama_n_head (const struct llama_context * ctx);
|
||||||
|
LLAMA_API int llama_n_rot (const struct llama_context * ctx);
|
||||||
LLAMA_API int llama_n_layer(const struct llama_context * ctx);
|
LLAMA_API int llama_n_layer(const struct llama_context * ctx);
|
||||||
|
|
||||||
LLAMA_API int llama_n_vocab_from_model(const struct llama_model * model);
|
LLAMA_API int llama_n_vocab_from_model(const struct llama_model * model);
|
||||||
LLAMA_API int llama_n_ctx_from_model (const struct llama_model * model);
|
LLAMA_API int llama_n_ctx_from_model (const struct llama_model * model);
|
||||||
LLAMA_API int llama_n_embd_from_model (const struct llama_model * model);
|
LLAMA_API int llama_n_embd_from_model (const struct llama_model * model);
|
||||||
|
LLAMA_API int llama_n_mult_from_model (const struct llama_model * model);
|
||||||
|
LLAMA_API int llama_n_head_from_model (const struct llama_model * model);
|
||||||
|
LLAMA_API int llama_n_rot_from_model (const struct llama_model * model);
|
||||||
LLAMA_API int llama_n_layer_from_model(const struct llama_model * model);
|
LLAMA_API int llama_n_layer_from_model(const struct llama_model * model);
|
||||||
|
|
||||||
// Get the vocabulary as output parameters.
|
// Get the vocabulary as output parameters.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue