(
self,
*,
token: int,
pos: int,
seq_id: int,
logits: bool,
)
| 1427 | ) |
| 1428 | |
| 1429 | def _add_batch_token( |
| 1430 | self, |
| 1431 | *, |
| 1432 | token: int, |
| 1433 | pos: int, |
| 1434 | seq_id: int, |
| 1435 | logits: bool, |
| 1436 | ) -> None: |
| 1437 | slot = int(self.batch.n_tokens) |
| 1438 | if slot >= self.n_batch: |
| 1439 | raise RuntimeError("MTP draft batch capacity exceeded") |
| 1440 | self.batch.token[slot] = int(token) |
| 1441 | self.batch.pos[slot] = int(pos) |
| 1442 | self.batch.seq_id[slot][0] = int(seq_id) |
| 1443 | self.batch.n_seq_id[slot] = 1 |
| 1444 | self.batch.logits[slot] = int(logits) |
| 1445 | self.batch.n_tokens += 1 |
| 1446 | |
| 1447 | def _try_decode_batch(self) -> bool: |
| 1448 | n_tokens = int(self.batch.n_tokens) |
no outgoing calls
no test coverage detected