Skip to content

Commit 5dfb439

Browse files
committed
cleanup
1 parent 5d8583b commit 5dfb439

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

llama_cpp/_ctypes_extensions.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import ctypes
66
import functools
77
import pathlib
8-
import logging
9-
import traceback
108

119
from typing import (
1210
Any,
@@ -20,9 +18,6 @@
2018
)
2119
from typing_extensions import TypeAlias
2220

23-
# Configure logging
24-
logging.basicConfig(level=logging.INFO)
25-
logger = logging.getLogger("llama_cpp.binding")
2621

2722
# Load the library
2823
def load_shared_library(lib_base_name: str, base_path: pathlib.Path):
@@ -115,21 +110,11 @@ def ctypes_function(
115110
):
116111
def decorator(f: F) -> F:
117112
if enabled:
118-
print(f"Setting up binding for C function: {name}") # Print when binding is created
119113
func = getattr(lib, name)
120114
func.argtypes = argtypes
121115
func.restype = restype
122-
123-
@functools.wraps(f)
124-
def wrapper(*args, **kwargs):
125-
print(f">>> Calling {name} with args: {args}") # Print right before C call
126-
sys.stdout.flush() # Force flush to ensure we see the output
127-
result = func(*args, **kwargs)
128-
print(f"<<< {name} returned successfully") # Print after successful return
129-
sys.stdout.flush()
130-
return result
131-
132-
return wrapper
116+
functools.wraps(f)(func)
117+
return func
133118
else:
134119
return f
135120

@@ -143,4 +128,4 @@ def _byref(obj: CtypesCData, offset: Optional[int] = None) -> CtypesRef[CtypesCD
143128
...
144129

145130

146-
byref = _byref if TYPE_CHECKING else ctypes.byref
131+
byref = _byref if TYPE_CHECKING else ctypes.byref

0 commit comments

Comments
 (0)