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
094891c0
Unverified
Commit
094891c0
authored
Apr 26, 2025
by
vzed
Committed by
GitHub
Apr 26, 2025
Browse files
fix: Use `is not None` instead of `!= None` for None checks. (#5687)
parent
a21ef363
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+2
-2
python/sglang/srt/code_completion_parser.py
python/sglang/srt/code_completion_parser.py
+1
-1
No files found.
python/sglang/bench_serving.py
View file @
094891c0
...
@@ -1000,7 +1000,7 @@ async def benchmark(
...
@@ -1000,7 +1000,7 @@ async def benchmark(
# Use the first request for all warmup iterations
# Use the first request for all warmup iterations
test_prompt
,
test_prompt_len
,
test_output_len
=
input_requests
[
0
]
test_prompt
,
test_prompt_len
,
test_output_len
=
input_requests
[
0
]
if
lora_names
!=
None
and
len
(
lora_names
)
!=
0
:
if
lora_names
is
not
None
and
len
(
lora_names
)
!=
0
:
lora_name
=
lora_names
[
0
]
lora_name
=
lora_names
[
0
]
else
:
else
:
lora_name
=
None
lora_name
=
None
...
@@ -1060,7 +1060,7 @@ async def benchmark(
...
@@ -1060,7 +1060,7 @@ async def benchmark(
tasks
:
List
[
asyncio
.
Task
]
=
[]
tasks
:
List
[
asyncio
.
Task
]
=
[]
async
for
request
in
get_request
(
input_requests
,
request_rate
):
async
for
request
in
get_request
(
input_requests
,
request_rate
):
prompt
,
prompt_len
,
output_len
=
request
prompt
,
prompt_len
,
output_len
=
request
if
lora_names
!=
None
and
len
(
lora_names
)
!=
0
:
if
lora_names
is
not
None
and
len
(
lora_names
)
!=
0
:
idx
=
random
.
randint
(
0
,
len
(
lora_names
)
-
1
)
idx
=
random
.
randint
(
0
,
len
(
lora_names
)
-
1
)
lora_name
=
lora_names
[
idx
]
lora_name
=
lora_names
[
idx
]
else
:
else
:
...
...
python/sglang/srt/code_completion_parser.py
View file @
094891c0
...
@@ -113,7 +113,7 @@ def completion_template_exists(template_name: str) -> bool:
...
@@ -113,7 +113,7 @@ def completion_template_exists(template_name: str) -> bool:
def
is_completion_template_defined
()
->
bool
:
def
is_completion_template_defined
()
->
bool
:
global
completion_template_name
global
completion_template_name
return
completion_template_name
!=
None
return
completion_template_name
is
not
None
def
generate_completion_prompt_from_request
(
request
:
ChatCompletionRequest
)
->
str
:
def
generate_completion_prompt_from_request
(
request
:
ChatCompletionRequest
)
->
str
:
...
...
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