Ignore detokenization error

This commit is contained in:
Lianmin Zheng
2024-01-30 14:52:06 +00:00
parent 1d0fbe8e43
commit 873d0e8537
2 changed files with 2 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ class DetokenizerManager:
int(output_tokens[i][0])
)
if not isinstance(first_token, str):
first_token = first_token.decode("utf-8")
first_token = first_token.decode("utf-8", errors="ignore")
if first_token.startswith(""):
output_strs[i] = " " + output_strs[i]

View File

@@ -320,7 +320,7 @@ def launch_server(server_args, pipe_finish_writer):
# Load chat template if needed
if server_args.chat_template is not None:
print(server_args.chat_template)
print(f"Use chat template: {server_args.chat_template}")
if not chat_template_exists(server_args.chat_template):
if not os.path.exists(server_args.chat_template):
raise RuntimeError(