Skip to content

Commit

Permalink
Fix text streaming in samples (#1488)
Browse files Browse the repository at this point in the history
Closes #1381

Co-authored-by: Vladimir Zlobin <vladimir.zlobin@intel.com>
  • Loading branch information
pavel-esir and Wovchena authored Jan 7, 2025
1 parent 827a1b7 commit 4003549
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def put(self, token_id: int) -> bool:
word = text[self.print_len:]
self.tokens_cache = []
self.print_len = 0
elif len(text) >= 3 and text[-3:] == chr(65533):
elif len(text) >= 3 and text[-1] == chr(65533):
# Don't print incomplete text.
pass
elif len(text) > self.print_len + delay_n_chars:
Expand Down
2 changes: 1 addition & 1 deletion tools/llm_bench/llm_bench_utils/ov_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def put(self, token_id: int) -> bool:
word = text[self.print_len:]
self.tokens_cache = []
self.print_len = 0
elif len(text) >= 3 and text[-3:] == chr(65533):
elif len(text) >= 3 and text[-1] == chr(65533):
# Don't print incomplete text.
pass
elif len(text) > self.print_len:
Expand Down

0 comments on commit 4003549

Please sign in to comment.