Skip to content

Commit 3c130f0

Browse files
author
Mug
committed
Remove try catch from chat
1 parent be2c961 commit 3c130f0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

examples/low_level_api/low_level_api_chat_cpp.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,7 @@ def input(self, prompt: str):
356356
def output(self):
357357
self.remaining_tokens = self.params.n_predict
358358
for id in self.generate():
359-
try:
360-
yield llama_cpp.llama_token_to_str(self.ctx, id).decode("utf-8", errors="ignore")
361-
except UnicodeDecodeError:
362-
pass
359+
yield llama_cpp.llama_token_to_str(self.ctx, id).decode("utf-8", errors="ignore")
363360

364361
# read user input
365362
def read_input(self):

0 commit comments

Comments
 (0)