@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / f8a1e39fae
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 17, 06:45 UTC

[BugFix] Define `__eq__` in SequenceGroupOutputs (#1389)

Woosuk Kwon committed Oct 17, 2023 at 01:09 UTC f8a1e39fae05ca610be8d5a78be9d40f5274e5fc
1 file changed +6
vllm/sequence.py
+6
@@ -401,6 +401,12 @@ class SequenceGroupOutputs:
401 return (f"SequenceGroupOutputs(samples={self.samples}, "
402 f"prompt_logprobs={self.prompt_logprobs})")
403
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 +
410
411 # For each sequence group, we generate a list of SequenceOutputs object,
412 # each of which contains one possible candidate for the next token.