fix: Use is not None instead of != None for None checks. (#5687)
This commit is contained in:
@@ -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(
|
|||||||
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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user