llama.cpp: fix unicode decoding (closes #6856)

This commit is contained in:
oobabooga 2025-04-19 16:38:02 -07:00
parent ba976d1390
commit 9c9df2063f

View file

@ -152,7 +152,7 @@ class LlamaServer:
full_text = ""
# Process the streaming response
for line in response.iter_lines(decode_unicode=True):
for line in response.iter_lines():
if shared.stop_everything:
break
@ -160,6 +160,8 @@ class LlamaServer:
continue
try:
line = line.decode('utf-8')
# Check if the line starts with "data: " and remove it
if line.startswith('data: '):
line = line[6:] # Remove the "data: " prefix