Skip to content

Commit

Permalink
Fix text streaming in samples
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-esir committed Jan 6, 2025
1 parent a475523 commit e7d00d9
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 e7d00d9

Please sign in to comment.