Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logger "Receive: obj=GenerateReqInput()" part with text rather than input_ids. #4045

Closed
9dian opened this issue Mar 4, 2025 · 2 comments
Closed
Assignees

Comments

@9dian
Copy link

9dian commented Mar 4, 2025

sglang 0.4.3 logger sample is as follows:

[2025-03-03 17:53:04] INFO: 10.27.1.1:65179 - "POST /v1/chat/completions HTTP/1.1" 200 OK
[2025-03-03 17:53:04] Receive: obj=GenerateReqInput(text=None, input_ids=[151646, 198, 5405, 1614, 25, 5538, 25713, 3795, 16, 25, 18, 17, 65, 198, 5405, 2400, 25, 220, 17, 15, 17, 20, 12, 15, 18, 12, 15, 18, 51, 15, 24, 25, 20, 18, 25, 16, 24, 13, 23, 21, 16, 57, 271, 2610, 525, 264, 10950, 17847, 13, 151644, 100633, 47815, 101562, 107380, 82894, 101437, 100968, 3837, 104719, 101914, 102513, 100371, 11319, 151645], input_embeds=None, image_data=None, sampling_params={'temperature': 0.1, 'max_new_tokens': None, 'min_new_tokens': 0, 'stop': None, 'stop_token_ids': None, 'top_p': 0.9, 'top_k': -1, 'min_p': 0.0, 'presence_penalty': 0.0, 'frequency_penalty': 0.0, 'repetition_penalty': 1.0, 'regex': None, 'ebnf': None, 'n': 1, 'no_stop_trim': False, 'ignore_eos': False, 'skip_special_tokens': True}, rid='ced00776101841e180bf04c8dbdc4ec2', return_logprob=False, logprob_start_len=-1, top_logprobs_num=0, return_text_in_logprobs=True, stream=True, log_metrics=True, modalities=[], lora_path=None, session_params=None, custom_logit_processor=None)
[2025-03-03 17:53:04 TP0] Prefill batch. #new-seq: 1, #new-token: 63, #cached-token: 1, cache hit rate: 1.41%, token usage: 0.00, #running-req: 0, #queue-req: 0
[2025-03-03 17:53:05 TP0] Decode batch. #running-req: 1, #token: 97, token usage: 0.00, gen throughput (token/s): 1.58, #queue-req: 0
[2025-03-03 17:53:06 TP0] Decode batch. #running-req: 1, #token: 137, token usage: 0.00, gen throughput (token/s): 55.91, #queue-req: 0

It show input_ids=[151646, 198, 5405, 1614, 25, 5538, 25713, 3795, 16, 25, 18, 17, 65, 198, 5405, 2400, 25, 220, 17, 15, 17, 20, 12, 15, 18, 12, 15, 18, 51, 15, 24, 25, 20, 18, 25, 16, 24, 13, 23, 21, 16, 57, 271, 2610, 525, 264, 10950, 17847, 13, 151644, 100633, 47815, 101562, 107380, 82894, 101437, 100968, 3837, 104719, 101914, 102513, 100371, 11319, 151645] in the log, could you please add text as substutition?

@minleminzui minleminzui self-assigned this Mar 4, 2025
@minleminzui
Copy link
Collaborator

thanks for raising your issue, You can do this yourself using transformers

from transformers import AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained("your model name")

input_ids = [151646, 198, 5405, 1614, 25, 5538, 25713, 3795, 16, 25, 18, 17, 65, 198, 5405, 2400, 25, 220, 17, 15, 17, 20, 12, 15, 18, 12, 15, 18, 51, 15, 24, 25, 20, 18, 25, 16, 24, 13, 23, 21, 16, 57, 271, 2610, 525, 264, 10950, 17847, 13, 151644, 100633, 47815, 101562, 107380, 82894, 101437, 100968, 3837, 104719, 101914, 102513, 100371, 11319, 151645]

text = tokenizer.decode(input_ids)

print(text)

@9dian
Copy link
Author

9dian commented Mar 4, 2025

Why not make the log more readable, then improve the Product usability...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants