Skip to content

Commit f8a1e39

Browse files
authored
[BugFix] Define __eq__ in SequenceGroupOutputs (#1389)
1 parent a132435 commit f8a1e39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vllm/sequence.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,12 @@ def __repr__(self) -> str:
401401
return (f"SequenceGroupOutputs(samples={self.samples}, "
402402
f"prompt_logprobs={self.prompt_logprobs})")
403403

404+
def __eq__(self, other: object) -> bool:
405+
if not isinstance(other, SequenceGroupOutputs):
406+
raise NotImplementedError()
407+
return (self.samples == other.samples
408+
and self.prompt_logprobs == other.prompt_logprobs)
409+
404410

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

0 commit comments

Comments
 (0)