File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -511,6 +511,7 @@ extern "C" {
511511 LLAMA_API int32_t llama_model_n_ctx_train (const struct llama_model * model);
512512 LLAMA_API int32_t llama_model_n_embd (const struct llama_model * model);
513513 LLAMA_API int32_t llama_model_n_layer (const struct llama_model * model);
514+ LLAMA_API int32_t llama_model_dev_layer (const struct llama_model * model, int32_t il);
514515 LLAMA_API int32_t llama_model_n_head (const struct llama_model * model);
515516 LLAMA_API int32_t llama_model_n_head_kv (const struct llama_model * model);
516517 LLAMA_API int32_t llama_model_n_swa (const struct llama_model * model);
Original file line number Diff line number Diff line change @@ -15103,6 +15103,11 @@ int32_t llama_model_n_layer(const llama_model * model) {
1510315103 return model->hparams.n_layer;
1510415104}
1510515105
15106+ int32_t llama_model_dev_layer(const llama_model * model, int32_t il) {
15107+ ggml_backend_dev_t dev = model->dev_layer(il);
15108+ return static_cast<int32_t>(ggml_backend_dev_type(dev));
15109+ }
15110+
1510615111int32_t llama_model_n_head(const llama_model * model) {
1510715112 return model->hparams.n_head();
1510815113}
You can’t perform that action at this time.
0 commit comments