You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will Missing '\n' during inference #3467
changed the title [-]When using sglang as the inference framework, if a word starting with a line break appears in the stop parameter, the sglang will not wrap during inference[/-][+]When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will not wrap during inference[/+]on Aug 6, 2024
changed the title [-]When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will not wrap during inference[/-][+]When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will Missing '\n' during inference[/+]on Aug 7, 2024
Opened a PR — the worker was testing partial stops on each chunk instead of the accumulated output, so a lone \n got dropped when a stop string started with newline.
Activity
[-]When using sglang as the inference framework, if a word starting with a line break appears in the stop parameter, the sglang will not wrap during inference[/-][+]When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will not wrap during inference[/+]nstl-zyb commentedon Aug 6, 2024
EG:
prompt = 请换行输出1-10个数字
stop = ['<|endoftext|>', '<|im_end|>', '<|im_start|>']
1
2
3
4
5
6
7
8
9
10
prompt = 请换行输出1-10个数字
stop = ['\n<|endoftext|>', '<|im_end|>', '<|im_start|>']
12345678910
"\n" can be followed by any character, and there will be no line break.
[-]When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will not wrap during inference[/-][+]When using sglang as the inference framework, if a word starting with "\n" appears in the stop parameter, the sglang will Missing '\n' during inference[/+]nstl-zyb commentedon Aug 7, 2024
After Test, it
s looks wrong in sglang_worker.py where check stop_str. But dont know how to fix.nstl-zyb commentedon Aug 8, 2024
This is the bug code when deal stop_str.
Chessing234 commentedon Jun 24, 2026
Opened a PR — the worker was testing partial stops on each chunk instead of the accumulated output, so a lone
\ngot dropped when a stop string started with newline.