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
1103dc62
Unverified
Commit
1103dc62
authored
Oct 12, 2025
by
Kai-Hsun Chen
Committed by
GitHub
Oct 12, 2025
Browse files
[chore][2/N] Avoid using default mutable parameters (#11479)
Signed-off-by:
Kai-Hsun Chen
<
khchen@x.ai
>
parent
a220536f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
python/sglang/srt/models/minicpmo.py
python/sglang/srt/models/minicpmo.py
+7
-2
python/sglang/test/test_utils.py
python/sglang/test/test_utils.py
+3
-1
No files found.
python/sglang/srt/models/minicpmo.py
View file @
1103dc62
...
@@ -795,8 +795,10 @@ class ConditionalChatTTS(PreTrainedModel):
...
@@ -795,8 +795,10 @@ class ConditionalChatTTS(PreTrainedModel):
force_no_stop
=
False
,
force_no_stop
=
False
,
min_new_token
=
10
,
min_new_token
=
10
,
max_new_token
=
50
,
max_new_token
=
50
,
logits_warpers
:
List
[
LogitsWarper
]
=
[],
logits_warpers
:
Optional
[
List
[
LogitsWarper
]]
=
None
,
logits_processors
:
List
[
CustomRepetitionPenaltyLogitsProcessorRepeat
]
=
[],
logits_processors
:
Optional
[
List
[
CustomRepetitionPenaltyLogitsProcessorRepeat
]
]
=
None
,
show_tqdm
=
False
,
show_tqdm
=
False
,
):
):
"""Generate audio codes in streaming setting or non-streaming setting.
"""Generate audio codes in streaming setting or non-streaming setting.
...
@@ -825,6 +827,9 @@ class ConditionalChatTTS(PreTrainedModel):
...
@@ -825,6 +827,9 @@ class ConditionalChatTTS(PreTrainedModel):
assert
input_ids
.
shape
[
0
]
==
1
assert
input_ids
.
shape
[
0
]
==
1
assert
past_key_values
is
not
None
assert
past_key_values
is
not
None
logits_warpers
=
logits_warpers
or
[]
logits_processors
=
logits_processors
or
[]
# fix: this should not be `input_ids.shape[1]`
# fix: this should not be `input_ids.shape[1]`
# start_idx = input_ids.shape[1]
# start_idx = input_ids.shape[1]
start_idx
=
(
start_idx
=
(
...
...
python/sglang/test/test_utils.py
View file @
1103dc62
...
@@ -503,7 +503,7 @@ def popen_launch_server(
...
@@ -503,7 +503,7 @@ def popen_launch_server(
base_url
:
str
,
base_url
:
str
,
timeout
:
float
,
timeout
:
float
,
api_key
:
Optional
[
str
]
=
None
,
api_key
:
Optional
[
str
]
=
None
,
other_args
:
list
[
str
]
=
[]
,
other_args
:
Optional
[
list
[
str
]
]
=
None
,
env
:
Optional
[
dict
]
=
None
,
env
:
Optional
[
dict
]
=
None
,
return_stdout_stderr
:
Optional
[
tuple
]
=
None
,
return_stdout_stderr
:
Optional
[
tuple
]
=
None
,
device
:
str
=
"auto"
,
device
:
str
=
"auto"
,
...
@@ -516,6 +516,8 @@ def popen_launch_server(
...
@@ -516,6 +516,8 @@ def popen_launch_server(
device: Device type ("auto", "cuda", "rocm" or "cpu").
device: Device type ("auto", "cuda", "rocm" or "cpu").
If "auto", will detect available platforms automatically.
If "auto", will detect available platforms automatically.
"""
"""
other_args
=
other_args
or
[]
# Auto-detect device if needed
# Auto-detect device if needed
if
device
==
"auto"
:
if
device
==
"auto"
:
device
=
auto_config_device
()
device
=
auto_config_device
()
...
...
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