Skip to content

Commit c56888f

Browse files
committed
c definitions
1 parent a7c63f9 commit c56888f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llama_cpp/_internals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def n_embd(self) -> int:
106106

107107
def n_layer(self) -> int:
108108
return llama_cpp.llama_n_layer(self.model)
109-
109+
110110
def dev_layer(self, il: int) -> LlamaBackendDev:
111111
return LlamaBackendDev(llama_cpp.llama_model_dev_layer(self.model, il))
112112

llama_cpp/llama_cpp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,11 @@ def llama_model_n_embd(model: llama_model_p, /) -> int:
14441444
def llama_model_n_layer(model: llama_model_p, /) -> int:
14451445
...
14461446

1447+
# LLAMA_API int32_t llama_model_dev_layer (const struct llama_model * model, int32_t il);
1448+
@ctypes_function("llama_model_dev_layer", [llama_model_p_ctypes, ctypes.c_int32], ctypes.c_int32)
1449+
def llama_model_dev_layer(model: llama_model_p, il: Union[ctypes.c_int32, int], /) -> int:
1450+
...
1451+
14471452

14481453
# LLAMA_API int32_t llama_model_n_head (const struct llama_model * model);
14491454
@ctypes_function("llama_model_n_head", [llama_model_p_ctypes], ctypes.c_int32)

0 commit comments

Comments
 (0)