Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
1f106ee3
Unverified
Commit
1f106ee3
authored
Oct 09, 2025
by
Xinyuan Tong
Committed by
GitHub
Oct 09, 2025
Browse files
[grammar] Avoid server crash when grammar backend is None (#11401)
parent
9b8ebb27
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
python/sglang/srt/managers/scheduler.py
python/sglang/srt/managers/scheduler.py
+22
-19
No files found.
python/sglang/srt/managers/scheduler.py
View file @
1f106ee3
...
@@ -1442,7 +1442,10 @@ class Scheduler(
...
@@ -1442,7 +1442,10 @@ class Scheduler(
or
req
.
sampling_params
.
ebnf
is
not
None
or
req
.
sampling_params
.
ebnf
is
not
None
or
req
.
sampling_params
.
structural_tag
is
not
None
or
req
.
sampling_params
.
structural_tag
is
not
None
):
):
assert
self
.
grammar_backend
is
not
None
if
self
.
grammar_backend
is
None
:
error_msg
=
"Grammar-based generation (json_schema, regex, ebnf, structural_tag) is not supported when the server is launched with --grammar-backend none"
req
.
set_finish_with_abort
(
error_msg
)
else
:
if
req
.
sampling_params
.
json_schema
is
not
None
:
if
req
.
sampling_params
.
json_schema
is
not
None
:
key
=
(
"json"
,
req
.
sampling_params
.
json_schema
)
key
=
(
"json"
,
req
.
sampling_params
.
json_schema
)
elif
req
.
sampling_params
.
regex
is
not
None
:
elif
req
.
sampling_params
.
regex
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment