Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 19234aa

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

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+2-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.