Skip to content

Commit

Permalink
[BugFix] Define __eq__ in SequenceGroupOutputs (vllm-project#1389)
Browse files Browse the repository at this point in the history
  • Loading branch information
WoosukKwon authored Oct 17, 2023
1 parent e958481 commit 112edf6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ def __repr__(self) -> str:
return (f"SequenceGroupOutputs(samples={self.samples}, "
f"prompt_logprobs={self.prompt_logprobs})")

def __eq__(self, other: object) -> bool:
if not isinstance(other, SequenceGroupOutputs):
raise NotImplementedError()
return (self.samples == other.samples
and self.prompt_logprobs == other.prompt_logprobs)


# For each sequence group, we generate a list of SequenceOutputs object,
# each of which contains one possible candidate for the next token.
Expand Down

0 comments on commit 112edf6

Please sign in to comment.