From f8a1e39fae05ca610be8d5a78be9d40f5274e5fc Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Tue, 17 Oct 2023 01:09:44 -0700 Subject: [PATCH] [BugFix] Define `__eq__` in SequenceGroupOutputs (#1389) --- vllm/sequence.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vllm/sequence.py b/vllm/sequence.py index 5847626b..ecfaee6e 100644 --- a/vllm/sequence.py +++ b/vllm/sequence.py @@ -401,6 +401,12 @@ class SequenceGroupOutputs: 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.