examples : make n_ctx warning work again (#3066)
This was broken by commit e36ecdcc
("build : on Mac OS enable Metal by
default (#2901)").
This commit is contained in:
parent
94f10b91ed
commit
e64f5b5578
5 changed files with 33 additions and 19 deletions
14
llama.cpp
14
llama.cpp
|
@ -5633,15 +5633,19 @@ void llama_free(struct llama_context * ctx) {
|
|||
}
|
||||
|
||||
int llama_n_vocab(const struct llama_context * ctx) {
|
||||
return ctx->model.vocab.id_to_token.size();
|
||||
return llama_model_n_vocab(&ctx->model);
|
||||
}
|
||||
|
||||
int llama_n_ctx(const struct llama_context * ctx) {
|
||||
return ctx->model.hparams.n_ctx;
|
||||
return llama_model_n_ctx(&ctx->model);
|
||||
}
|
||||
|
||||
int llama_n_ctx_train(const struct llama_context * ctx) {
|
||||
return llama_model_n_ctx_train(&ctx->model);
|
||||
}
|
||||
|
||||
int llama_n_embd(const struct llama_context * ctx) {
|
||||
return ctx->model.hparams.n_embd;
|
||||
return llama_model_n_embd(&ctx->model);
|
||||
}
|
||||
|
||||
enum llama_vocab_type llama_vocab_type(const struct llama_context * ctx) {
|
||||
|
@ -5656,6 +5660,10 @@ int llama_model_n_ctx(const struct llama_model * model) {
|
|||
return model->hparams.n_ctx;
|
||||
}
|
||||
|
||||
int llama_model_n_ctx_train(const struct llama_model * model) {
|
||||
return model->hparams.n_ctx_train;
|
||||
}
|
||||
|
||||
int llama_model_n_embd(const struct llama_model * model) {
|
||||
return model->hparams.n_embd;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue