Skip to content

Commit 11d9562

Browse files
xu-songabetlen
andauthored
misc: Rename all_text to remaining_text (#1658)
Co-authored-by: Andrei <abetlen@gmail.com>
1 parent 9992c50 commit 11d9562

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
@@ -1519,15 +1519,15 @@ def logit_bias_processor(
15191519

15201520
if stream:
15211521
remaining_tokens = completion_tokens[returned_tokens:]
1522-
all_text = self.detokenize(
1522+
remaining_text = self.detokenize(
15231523
remaining_tokens,
15241524
prev_tokens=prompt_tokens + completion_tokens[:returned_tokens],
15251525
)
1526-
any_stop = [s for s in stop_sequences if s in all_text]
1526+
any_stop = [s for s in stop_sequences if s in remaining_text]
15271527
if len(any_stop) > 0:
1528-
end = min(all_text.index(stop) for stop in any_stop)
1528+
end = min(remaining_text.index(stop) for stop in any_stop)
15291529
else:
1530-
end = len(all_text)
1530+
end = len(remaining_text)
15311531

15321532
token_end_position = 0
15331533
for token in remaining_tokens:

0 commit comments

Comments
 (0)