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
f065e5be
Unverified
Commit
f065e5be
authored
Sep 29, 2025
by
Chang Su
Committed by
GitHub
Sep 29, 2025
Browse files
[router] Use `get_pooled` in `process_single_choice` (#11079)
parent
9de1320b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
sgl-router/src/routers/grpc/router.rs
sgl-router/src/routers/grpc/router.rs
+14
-12
No files found.
sgl-router/src/routers/grpc/router.rs
View file @
f065e5be
...
...
@@ -769,20 +769,22 @@ impl GrpcRouter {
// Check if reasoning parsing is enabled and separate_reasoning is requested
if
original_request
.separate_reasoning
{
if
let
Ok
(
mut
parser
)
=
self
let
pooled_
parser
=
self
.reasoning_parser_factory
.create
(
&
original_request
.model
)
{
match
parser
.detect_and_parse_reasoning
(
&
processed_text
)
{
Ok
(
result
)
=>
{
if
!
result
.reasoning_text
.is_empty
()
{
reasoning_text
=
Some
(
result
.reasoning_text
);
}
processed_text
=
result
.normal_text
;
}
Err
(
e
)
=>
{
return
Err
(
format!
(
"Reasoning parsing error: {}"
,
e
));
.get_pooled
(
&
original_request
.model
);
let
mut
parser
=
pooled_parser
.lock
()
.map_err
(|
e
|
format!
(
"Failed to acquire reasoning parser lock: {}"
,
e
))
?
;
match
parser
.detect_and_parse_reasoning
(
&
processed_text
)
{
Ok
(
result
)
=>
{
if
!
result
.reasoning_text
.is_empty
()
{
reasoning_text
=
Some
(
result
.reasoning_text
);
}
processed_text
=
result
.normal_text
;
}
Err
(
e
)
=>
{
return
Err
(
format!
(
"Reasoning parsing error: {}"
,
e
));
}
}
}
...
...
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