Skip to content

Commit 305e851

Browse files
author
Justin Foutts
committed
Simlify range
1 parent ce04856 commit 305e851

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

inference/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwa
3434
if first:
3535
text = text.lstrip()
3636
for stop_word in self._stop_words:
37-
for i in range(len(stop_word), 0, -1):
37+
for i in range(1, len(stop_word)):
3838
if self._partial_result.endswith(stop_word[0:i]):
3939
self._stream_buffer += text
4040
return False

0 commit comments

Comments
 (0)