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 926b414

Browse filesBrowse files
committed
feat: Update llama.cpp
1 parent 4744551 commit 926b414
Copy full SHA for 926b414

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+8
-1
lines changed

‎llama_cpp/_logger.py

Copy file name to clipboardExpand all lines: llama_cpp/_logger.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@
1010
# GGML_LOG_LEVEL_WARN = 2,
1111
# GGML_LOG_LEVEL_ERROR = 3,
1212
# GGML_LOG_LEVEL_DEBUG = 4,
13+
# GGML_LOG_LEVEL_CONT = 5, // continue previous log
1314
# };
1415
GGML_LOG_LEVEL_TO_LOGGING_LEVEL = {
1516
0: logging.CRITICAL,
1617
1: logging.INFO,
1718
2: logging.WARNING,
1819
3: logging.ERROR,
1920
4: logging.DEBUG,
21+
5: logging.DEBUG,
2022
}
2123

2224
logger = logging.getLogger("llama-cpp-python")
2325

26+
_last_log_level = GGML_LOG_LEVEL_TO_LOGGING_LEVEL[0]
2427

2528
# typedef void (*ggml_log_callback)(enum ggml_log_level level, const char * text, void * user_data);
2629
@llama_cpp.llama_log_callback
@@ -29,8 +32,12 @@ def llama_log_callback(
2932
text: bytes,
3033
user_data: ctypes.c_void_p,
3134
):
35+
# TODO: Correctly implement continue previous log
36+
global _last_log_level
37+
log_level = GGML_LOG_LEVEL_TO_LOGGING_LEVEL[level] if level != 5 else _last_log_level
3238
if logger.level <= GGML_LOG_LEVEL_TO_LOGGING_LEVEL[level]:
3339
print(text.decode("utf-8"), end="", flush=True, file=sys.stderr)
40+
_last_log_level = log_level
3441

3542

3643
llama_cpp.llama_log_set(llama_log_callback, ctypes.c_void_p(0))

‎vendor/llama.cpp

Copy file name to clipboard

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.