Slice columns (per-row top-k logprobs and token IDs). Keeps the number of requests unchanged.
(self, start: int, end: int)
| 47 | sampled_token_ranks: list[int] |
| 48 | |
| 49 | def slice_columns(self, start: int, end: int): |
| 50 | """ |
| 51 | Slice columns (per-row top-k logprobs and token IDs). |
| 52 | Keeps the number of requests unchanged. |
| 53 | """ |
| 54 | return LogprobsLists( |
| 55 | [row[start:end] for row in self.logprob_token_ids], |
| 56 | [row[start:end] for row in self.logprobs], |
| 57 | self.sampled_token_ranks, # unchanged |
| 58 | ) |
| 59 | |
| 60 | def slice_rows(self, start: int, end: int): |
| 61 | """ |