MCPcopy Create free account
hub / github.com/MLSysU/TD-Pipe / SequenceGroupOutput

Class SequenceGroupOutput

TD_Pipe/sequence.py:399–418  ·  view source on GitHub ↗

The model output associated with a sequence group.

Source from the content-addressed store, hash-verified

397
398
399class SequenceGroupOutput:
400 """The model output associated with a sequence group."""
401
402 def __init__(
403 self,
404 samples: List[SequenceOutput],
405 prompt_logprobs: Optional[PromptLogprobs],
406 ) -> None:
407 self.samples = samples
408 self.prompt_logprobs = prompt_logprobs
409
410 def __repr__(self) -> str:
411 return (f"SequenceGroupOutput(samples={self.samples}, "
412 f"prompt_logprobs={self.prompt_logprobs})")
413
414 def __eq__(self, other: object) -> bool:
415 if not isinstance(other, SequenceGroupOutput):
416 raise NotImplementedError()
417 return (self.samples == other.samples
418 and self.prompt_logprobs == other.prompt_logprobs)
419
420
421# For each sequence group, we generate a list of SequenceOutput object,

Callers 1

_build_sampler_outputFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected