Skip to content

Commit 6f1af73

Browse files
committed
checkpoint
1 parent c049ed7 commit 6f1af73

File tree

2 files changed

+545
-501
lines changed

2 files changed

+545
-501
lines changed

llama_cpp/llama.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,12 @@ def logit_bias_processor(
13481348
if len(any_stop) > 0:
13491349
first_stop = any_stop[0]
13501350
text = all_text[: all_text.index(first_stop)]
1351-
finish_reason = "stop"
1351+
# Ensure first_stop is a string for concatenation
1352+
if isinstance(first_stop, bytes):
1353+
first_stop_str = first_stop.decode("utf-8", errors="replace")
1354+
else:
1355+
first_stop_str = first_stop
1356+
finish_reason = "stop:" + first_stop_str
13521357
break
13531358

13541359
if stream:

0 commit comments

Comments
 (0)