Skip to content

Commit

Permalink
return False in stop_by_length if request is already finished
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Dec 10, 2023
1 parent 70369fc commit b16f787
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions serve/mlc_serve/engine/engine_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def should_stop_by_length(state: RequestState, max_context_length: int) -> bool:
# TODO: currently, we simply return true for both stopping reasons.
# in the future, we can differentiate these two.
# this include prompt tokens and gen tokens so far
if state.is_finished:
return False

for gen_seq in state.generation_sequences:
if gen_seq.is_finished:
continue
Expand Down

0 comments on commit b16f787

Please sign in to comment.