Skip to content

Commit

Permalink
fix: crash when cancelling a request with multi-step (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpinDale authored Dec 24, 2024
1 parent 3e4e766 commit d4e78a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion aphrodite/engine/output_processor/multi_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,16 @@ def process_outputs(self,
"""
# TODO: Add support for async if necessary
assert not is_async

# Sequences can be in RUNNING or FINISHED_ABORTED state
# once scheduled, as a sequence is moved to FINSIHED_ABORTED
# if a client disconnects from the api server.
seqs = sequence_group.get_seqs(status=SequenceStatus.RUNNING)
if seqs is None:
seqs = sequence_group.get_seqs(
status=SequenceStatus.FINISHED_ABORTED)

assert seqs, "expected running sequences"
assert seqs, "Expected RUNNING or FINISHED_ABORTED sequences"
assert len(seqs) == 1, (
"Beam search not supported in multi-step decoding.")
seq = seqs[0]
Expand Down

0 comments on commit d4e78a4

Please sign in to comment.