Skip to content

Commit 60f4275

Browse files
authored
Merge pull request #136 from droans/fix-incomplete-tokens
Fix: Don't use incomplete tokens
2 parents 9c166b2 + 2ef31d5 commit 60f4275

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/engine/ov_genai/streamers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def write(self, token: Union[int, List[int]]) -> openvino_genai.StreamingStatus:
4444
# Emit only the newly materialized portion
4545
if len(text) > self.last_print_len:
4646
chunk = text[self.last_print_len:]
47+
if chr(65533) in chunk:
48+
self.since_last_emit -= 1
49+
return openvino_genai.StreamingStatus.RUNNING
4750
if chunk:
4851
self.text_queue.put_nowait(chunk)
4952
self.last_print_len = len(text)

0 commit comments

Comments
 (0)