fix(function_call): fallback to decode when batch decode options differ (#15155)

Signed-off-by: luqitao <luqt@awcloud.com>
This commit is contained in:
luqitao
2025-12-17 12:21:08 +08:00
committed by GitHub
parent 03f9eb2564
commit 0129c911e0

View File

@@ -179,7 +179,11 @@ class DetokenizerManager(MultiHttpWorkerDetokenizerMixin):
# Decode token ids to strings
# TODO(lmzheng): handle skip_special_tokens/spaces_between_special_tokens per request
if not self.disable_tokenizer_batch_decode:
skip_uniform = len(set(recv_obj.skip_special_tokens)) == 1
space_uniform = len(set(recv_obj.spaces_between_special_tokens)) == 1
if not self.disable_tokenizer_batch_decode or not (
skip_uniform and space_uniform
):
if not self.is_dummy:
# Run normal batch decode
surr_texts = self.tokenizer.batch_decode(