(
self,
prev_tokens: Sequence[int],
prev_text_bytes: Union[bytes, bytearray],
token: int,
)
| 12068 | return current[len(previous) :] |
| 12069 | |
| 12070 | def token_bytes_with_prev_bytes( |
| 12071 | self, |
| 12072 | prev_tokens: Sequence[int], |
| 12073 | prev_text_bytes: Union[bytes, bytearray], |
| 12074 | token: int, |
| 12075 | ) -> bytes: |
| 12076 | current = self.detokenize([*prev_tokens, token]) |
| 12077 | return current[len(prev_text_bytes) :] |
| 12078 | |
| 12079 | def clear_batch(self) -> None: |
| 12080 | self.batch.n_tokens = 0 |
no test coverage detected