Skip to content

Commit

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

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
  • Loading branch information
pavel-esir and ilya-lavrenov authored Jan 7, 2025
1 parent 9ac38f0 commit d7d117a
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 @@ -90,7 +90,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
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 @@ -701,7 +701,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 d7d117a

Please sign in to comment.