10000 fix: Restore type hints for low-level api · coderonion/llama-cpp-python@19234aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 19234aa

Browse files
committed
fix: Restore type hints for low-level api
1 parent 2292af5 commit 19234aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llama_cpp/llama_cpp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ class CtypesRef(Generic[CtypesCData]):
109109

110110
CtypesFuncPointer: TypeAlias = ctypes._FuncPointer # type: ignore
111111

112+
F = TypeVar("F", bound=Callable[..., Any])
112113

113114
def ctypes_function_for_shared_library(lib: ctypes.CDLL):
114115
def ctypes_function(
115116
name: str, argtypes: List[Any], restype: Any, enabled: bool = True
116117
):
117-
def decorator(f: Callable[..., Any]):
118+
def decorator(f: F) -> F:
118119
if enabled:
119120
func = getattr(lib, name)
120121
func.argtypes = argtypes

0 commit comments

Comments
 (0)
0