Skip to content

Commit 478a770

Browse files
authored
Refactor all_text to remaining_text
1 parent 5575fed commit 478a770

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llama_cpp/llama.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,15 +1409,15 @@ def logit_bias_processor(
14091409

14101410
if stream:
14111411
remaining_tokens = completion_tokens[returned_tokens:]
1412-
all_text = self.detokenize(
1412+
remaining_text = self.detokenize(
14131413
remaining_tokens,
14141414
prev_tokens=prompt_tokens + completion_tokens[:returned_tokens],
14151415
)
1416-
any_stop = [s for s in stop_sequences if s in all_text]
1416+
any_stop = [s for s in stop_sequences if s in remaining_text]
14171417
if len(any_stop) > 0:
1418-
end = min(all_text.index(stop) for stop in any_stop)
1418+
end = min(remaining_text.index(stop) for stop in any_stop)
14191419
else:
1420-
end = len(all_text)
1420+
end = len(remaining_text)
14211421

14221422
token_end_position = 0
14231423
for token in remaining_tokens:

0 commit comments

Comments
 (0)