We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 305e851 commit aff0827Copy full SHA for aff0827
1 file changed
inference/bot.py
@@ -33,6 +33,7 @@ def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwa
33
if self._stream_callback:
34
if first:
35
text = text.lstrip()
36
+ # buffer tokens if the partial result ends with a prefix of a stop word, e.g. "<hu"
37
for stop_word in self._stop_words:
38
for i in range(1, len(stop_word)):
39
if self._partial_result.endswith(stop_word[0:i]):
0 commit comments