File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
fastdeploy/entrypoints/openai Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -788,13 +788,13 @@ def _build_logprobs_response(
788788 [tid ], clean_up_tokenization_spaces = False
789789 )
790790 if "\ufffd " in token_str :
791- token_bytes = token_str .encode ("utf-8" , errors = "replace" )
791+ raw_token = self .engine_client .data_processor .tokenizer .convert_ids_to_tokens (tid )
792+ token_bytes = raw_token .encode ("utf-8" , errors = "replace" )
792793 token_str = "bytes:" + "" .join (f"\\ x{ byte :02x} " for byte in token_bytes )
793794 if idx == 0 :
794795 tokens .append (token_str )
795796 token_logprobs .append (lp )
796- else :
797- top_logprobs [token_str ] = lp
797+ top_logprobs [token_str ] = lp
798798 idx += 1
799799
800800 # Construct the sampled token object (avoid sharing references with top_logprob_entries)
You can’t perform that action at this time.
0 commit comments