mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-08 06:33:51 +01:00
Fix llama-server output filter for new log format
This commit is contained in:
parent
d0ac58ad31
commit
93ebfa2b7e
|
|
@ -520,6 +520,8 @@ def filter_stderr_with_progress(process_stderr):
|
|||
inline (overwriting the same line) until completion.
|
||||
"""
|
||||
progress_re = re.compile(r'slot update_slots: id.*progress = (\d+\.\d+)')
|
||||
ansi_re = re.compile(r'\x1b\[[0-9;]*[a-zA-Z]')
|
||||
log_prefix_re = re.compile(r'^[IWED] ')
|
||||
last_was_progress = False
|
||||
|
||||
try:
|
||||
|
|
@ -538,6 +540,7 @@ def filter_stderr_with_progress(process_stderr):
|
|||
line_bytes, buffer = buffer.split(b'\n', 1)
|
||||
try:
|
||||
line = line_bytes.decode('utf-8', errors='replace').strip('\r\n')
|
||||
line = log_prefix_re.sub('', ansi_re.sub('', line))
|
||||
if line: # Process non-empty lines
|
||||
match = progress_re.search(line)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue