Skip to content

Commit 094891c

Browse files
authored
fix: Use is not None instead of != None for None checks. (#5687)
1 parent a21ef36 commit 094891c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/sglang/bench_serving.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ async def limited_request_func(request_func_input, pbar):
10001000

10011001
# Use the first request for all warmup iterations
10021002
test_prompt, test_prompt_len, test_output_len = input_requests[0]
1003-
if lora_names != None and len(lora_names) != 0:
1003+
if lora_names is not None and len(lora_names) != 0:
10041004
lora_name = lora_names[0]
10051005
else:
10061006
lora_name = None
@@ -1060,7 +1060,7 @@ async def limited_request_func(request_func_input, pbar):
10601060
tasks: List[asyncio.Task] = []
10611061
async for request in get_request(input_requests, request_rate):
10621062
prompt, prompt_len, output_len = request
1063-
if lora_names != None and len(lora_names) != 0:
1063+
if lora_names is not None and len(lora_names) != 0:
10641064
idx = random.randint(0, len(lora_names) - 1)
10651065
lora_name = lora_names[idx]
10661066
else:

python/sglang/srt/code_completion_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def completion_template_exists(template_name: str) -> bool:
113113

114114
def is_completion_template_defined() -> bool:
115115
global completion_template_name
116-
return completion_template_name != None
116+
return completion_template_name is not None
117117

118118

119119
def generate_completion_prompt_from_request(request: ChatCompletionRequest) -> str:

0 commit comments

Comments
 (0)