Fix after QWen support (#82)

This commit is contained in:
Lianmin Zheng
2024-01-22 21:17:05 -08:00
committed by GitHub
parent 63e97e5e4c
commit 94e05770db
4 changed files with 46 additions and 43 deletions

View File

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