Skip to content

Commit 6d80d61

Browse files
committed
c definitions
1 parent ceb2a7e commit 6d80d61

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
@@ -1428,6 +1428,11 @@ def llama_model_n_embd(model: llama_model_p, /) -> int:
14281428
def llama_model_n_layer(model: llama_model_p, /) -> int:
14291429
...
14301430

1431+
# LLAMA_API int32_t llama_model_dev_layer (const struct llama_model * model, int32_t il);
1432+
@ctypes_function("llama_model_dev_layer", [llama_model_p_ctypes, ctypes.c_int32], ctypes.c_int32)
1433+
def llama_model_dev_layer(model: llama_model_p, il: Union[ctypes.c_int32, int], /) -> int:
1434+
...
1435+
14311436

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

0 commit comments

Comments
 (0)