Skip to content

Commit

Permalink
change asssert to if
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Dec 8, 2023
1 parent 55045d0 commit f73a430
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions serve/mlc_serve/engine/staging_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,15 @@ def step(self) -> InferenceStepResult:
if seq_output.finish_reason is not None:
del self.requests[request_id]

assert prev_request_id and len(out_seqs) > 0 and prev_prompt_len is not None

# Add output sequences for the last request.
outputs.append(
RequestOutput(
prev_request_id,
sequences=out_seqs,
num_prompt_tokens=prev_prompt_len,
if prev_request_id and prev_prompt_len:
# Add output sequences for the last request.
outputs.append(
RequestOutput(
prev_request_id,
sequences=out_seqs,
num_prompt_tokens=prev_prompt_len,
)
)
)

return InferenceStepResult(outputs=outputs)

Expand Down

0 comments on commit f73a430

Please sign in to comment.