Skip to content

Commit aff0827

Browse files
author
Justin Foutts
committed
Add comment
1 parent 305e851 commit aff0827

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

inference/bot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwa
3333
if self._stream_callback:
3434
if first:
3535
text = text.lstrip()
36+
# buffer tokens if the partial result ends with a prefix of a stop word, e.g. "<hu"
3637
for stop_word in self._stop_words:
3738
for i in range(1, len(stop_word)):
3839
if self._partial_result.endswith(stop_word[0:i]):

0 commit comments

Comments
 (0)