fix(function_call): fallback to decode when batch decode options differ (#15155)
Signed-off-by: luqitao <luqt@awcloud.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user