Skip to content

Commit

Permalink
simplify typing
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Dec 8, 2023
1 parent 5585197 commit 421d2ea
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions serve/mlc_serve/engine/staging_engine_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ def wait_for_request(self, timeout_seconds=None):
)

def has_pending_requests(self) -> bool:
return (
len(self.queue) != 0
or len(self.current_batch) != 0
or len(self.cancelled_requests) != 0
)
return bool(self.queue or self.current_batch or self.cancelled_requests)

def step(self) -> GenerationLoopWorkerOutput:
LOG.debug("Starting new inference step.")
Expand Down Expand Up @@ -300,7 +296,7 @@ def _get_requests_to_process(self):
return requests, is_prompt_batch

def _has_request_to_process(self) -> bool:
return len(self.queue) != 0 or len(self.current_batch) != 0
return bool(self.queue or self.current_batch)


def run_generation_loop_worker(
Expand Down

0 comments on commit 421d2ea

Please sign in to comment.